Ignore:
Timestamp:
Mar 2, 2014, 2:50:25 AM (11 years ago)
Author:
iritscen
Message:

Latest version of glass-breaking patch (this ONCC patch does not work, though). Removed DangerousGlass as it is now a package on Depot.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • AE/packages/31000GlassBreakingMoves/patches/common/level0_Final/ONCC-.oni-patch

    r950 r965  
    11@XML_TOOLS Version "2.0"
    22
    3 @ADD_INSIDE_NODES ElementName "Particles" ParentElementName "ONCP"
    4 <xml>
    5         <ONCPParticle>
    6                 <Name>glass_break</Name>
    7                 <Type>glass_break</Type>
    8                 <BodyPart>None</BodyPart>
    9         </ONCPParticle>
    10 </xml>
     3@CUSTOM_CODE
     4<code>
     5        var myBuilder = new JSXMLBuilder();
     6        myBuilder.load($xmlData);
     7        var elements = myBuilder.elements[0];
     8       
     9        // If there are no attacks in this TRAM, ignore it
     10        if (!elements.childElement("ONCP").childElement("Particles"))
     11                return;
     12                                               
     13        // Check if glass_break is already registered for the character
     14        var particles = elements.childElement("ONCP").childElement("Particles");
     15        for (var i = 0; (particles.childElement(i)); i++)
     16        {
     17                var particle = particles.childElement(i);
     18                if (particle.childElement("Name").text == "glass_break")
     19                        return;
     20        }
     21
     22        // If we're still here, register glass_break
     23        myBuilder.addElementAt("ONCPParticle",
     24                                "",
     25                                "<Name>glass_break</Name>\
     26                                 <Type>glass_break</Type>\
     27                                 <BodyPart>None</BodyPart>",
     28                                particles.index + 1,
     29                                particles.level + 1);
     30</code>
Note: See TracChangeset for help on using the changeset viewer.