Ticket #1166: 1166.patch
File 1166.patch, 18.5 KB (added by , 12 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Health.js
15 15 "<data type='positiveInteger'/>" + 16 16 "</element>" + 17 17 "</optional>" + 18 "<optional>" + 19 "<element name='DeathRemnant' a:help='Entity template to spawn after death'>" + 20 "<text/>" + 21 "</element>" + 22 "</optional>" + 18 23 "<element name='RegenRate' a:help='Hitpoint regeneration rate per second. Not yet implemented'>" + 19 24 "<ref name='nonNegativeDecimal'/>" + 20 25 "</element>" + … … 112 117 state.killed = true; 113 118 114 119 PlaySound("death", this.entity); 115 120 121 122 //If there is DeathRemnant set, spawn it. 123 if(this.template.DeathRemnant) 124 { 125 this.CreateDeathRemnant(); 126 } 116 127 if (this.template.DeathType == "corpse") 117 128 { 118 129 this.CreateCorpse(); … … 172 183 173 184 //// Private functions //// 174 185 186 Health.prototype.CreateDeathRemnant = function() 187 { 188 // If the unit died while not in the world, don't create DeathRemnant for it 189 // since there's nowhere for it to be placed 190 var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); 191 if (!cmpPosition.IsInWorld()) 192 return; 193 194 //Create DeathRemnant entity 195 var deathRemnant = Engine.AddLocalEntity(this.template.DeathRemnant); 196 197 //And set it to same place as base entity 198 var cmpDeathRemnantPosition = Engine.QueryInterface(deathRemnant, IID_Position); 199 var pos = cmpPosition.GetPosition(); 200 cmpDeathRemnantPosition.JumpTo(pos.x, pos.z); 201 var rot = cmpPosition.GetRotation(); 202 cmpDeathRemnantPosition.SetYRotation(rot.y); 203 cmpDeathRemnantPosition.SetXZRotation(rot.x, rot.z); 204 } 205 175 206 Health.prototype.CreateCorpse = function() 176 207 { 177 208 // If the unit died while not in the world, don't create any corpse for it -
binaries/data/mods/public/simulation/templates/rubble/rubble_1x1.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_1x1.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_1x1pal.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_1x1pal.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_1x3pal.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_1x3pal.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_2x2.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_2x2.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_2x4.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_2x4.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_3x3.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_3x3.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_3x6.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_3x6.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_4x2.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_4x2.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_4x4.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_4x4.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_4x4_dock.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_4x4_dock.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_4x6.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_4x6.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_5x5.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_5x5.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_6x4.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_6x4.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_6x4_dock.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_6x4.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_6x6.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_6x6.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/rubble/rubble_8x8.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="template_rubble"> 3 <VisualActor> 4 <Actor>structures/fndn_8x8.xml</Actor> 5 </VisualActor> 6 </Entity> 7 No newline at end of file -
binaries/data/mods/public/simulation/templates/template_rubble.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <Entity parent="special/actor"> 3 <Decay> 4 <DelayTime>3.0</DelayTime> 5 <SinkRate>0.2</SinkRate> 6 <SinkAccel>0</SinkAccel> 7 </Decay> 8 </Entity> 9 No newline at end of file -
binaries/data/mods/public/simulation/templates/template_structure_civic_civil_centre.xml
53 53 </GarrisonHolder> 54 54 <Health> 55 55 <Max>3000</Max> 56 <DeathRemnant>rubble/rubble_6x6</DeathRemnant> 56 57 </Health> 57 58 <Identity> 58 59 <GenericName>Civic Centre</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_civic_house.xml
21 21 </Footprint> 22 22 <Health> 23 23 <Max>800</Max> 24 <DeathRemnant>rubble/rubble_3x3</DeathRemnant> 24 25 </Health> 25 26 <Identity> 26 27 <GenericName>House</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_civic_temple.xml
34 34 </GarrisonHolder> 35 35 <Health> 36 36 <Max>2000</Max> 37 <DeathRemnant>rubble/rubble_4x6</DeathRemnant> 37 38 </Health> 38 39 <Identity> 39 40 <GenericName>Temple</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_defense_defense_tower.xml
45 45 </GarrisonHolder> 46 46 <Health> 47 47 <Max>1200</Max> 48 <DeathRemnant>rubble/rubble_2x2</DeathRemnant> 48 49 </Health> 49 50 <Identity> 50 51 <GenericName>Defense Tower</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_defense_outpost.xml
45 45 </GarrisonHolder> 46 46 <Health> 47 47 <Max>800</Max> 48 <DeathRemnant>rubble/rubble_2x2</DeathRemnant> 48 49 </Health> 49 50 <Identity> 50 51 <GenericName>Outpost</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_defense_wall_tower.xml
44 44 </GarrisonHolder> 45 45 <Health> 46 46 <Max>4000</Max> 47 <DeathRemnant>rubble/rubble_2x2</DeathRemnant> 47 48 </Health> 48 49 <Identity> 49 50 <GenericName>Wall Turret</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_economic_farmstead.xml
20 20 </Footprint> 21 21 <Health> 22 22 <Max>900</Max> 23 <DeathRemnant>rubble/rubble_3x3</DeathRemnant> 23 24 </Health> 24 25 <Identity> 25 26 <GenericName>Farmstead</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_economic_market.xml
20 20 </Footprint> 21 21 <Health> 22 22 <Max>1500</Max> 23 <DeathRemnant>rubble/rubble_5x5</DeathRemnant> 23 24 </Health> 24 25 <Identity> 25 26 <GenericName>Market</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_economic_mill.xml
20 20 </Footprint> 21 21 <Health> 22 22 <Max>800</Max> 23 <DeathRemnant>rubble/rubble_3x3</DeathRemnant> 23 24 </Health> 24 25 <Identity> 25 26 <GenericName>Mill</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_military_barracks.xml
27 27 </GarrisonHolder> 28 28 <Health> 29 29 <Max>2000</Max> 30 <DeathRemnant>rubble/rubble_4x4</DeathRemnant> 30 31 </Health> 31 32 <Identity> 32 33 <GenericName>Barracks</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_military_dock.xml
23 23 </Footprint> 24 24 <Health> 25 25 <Max>2500</Max> 26 <DeathRemnant>rubble/rubble_4x4_dock</DeathRemnant> 26 27 </Health> 27 28 <Identity> 28 29 <GenericName>Dock</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_military_embassy.xml
14 14 <GarrisonHolder disable=""/> 15 15 <Health> 16 16 <Max>2000</Max> 17 <DeathRemnant>rubble/rubble_3x3</DeathRemnant> 17 18 </Health> 18 19 <Identity> 19 20 <Civ>cart</Civ> -
binaries/data/mods/public/simulation/templates/template_structure_military_fortress.xml
46 46 </GarrisonHolder> 47 47 <Health> 48 48 <Max>4200</Max> 49 <DeathRemnant>rubble/rubble_6x6</DeathRemnant> 49 50 </Health> 50 51 <Identity> 51 52 <GenericName>Fortress</GenericName> -
binaries/data/mods/public/simulation/templates/template_structure_special.xml
25 25 </GarrisonHolder> 26 26 <Health> 27 27 <Max>2000</Max> 28 <DeathRemnant>rubble/rubble_5x5</DeathRemnant> 28 29 </Health> 29 30 <Identity> 30 31 <GenericName>Special Building</GenericName>