ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/AE/packages/31000GlassBreakingMoves/patches/common/level0_Final/ONCC-.oni-patch
Revision: 965
Committed: Sun Mar 2 01:50:25 2014 UTC (11 years, 9 months ago) by iritscen
File size: 896 byte(s)
Log 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 Contents

# Content
1 @XML_TOOLS Version "2.0"
2
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>