Ticket #3983: damageAndSeasonVariants.diff
File damageAndSeasonVariants.diff, 12.1 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/art/actors/structures/gauls/civic_centre.xml
16 16 <prop actor="props/units/weapons/arrow_front.xml" attachpoint="projectile"/> 17 17 </props> 18 18 <textures> 19 <texture file="structural/celt_struct_1.dds" name="baseTex"/>20 19 <texture file="structural/celt_struct_1_norm.png" name="normTex"/> 21 20 <texture file="structural/celt_struct_1_spec.png" name="specTex"/> 22 21 <texture file="structural/ao/gaul_civic_centre.png" name="aoTex"/> … … 24 23 </variant> 25 24 </group> 26 25 <group> 26 <variant name="summer" frequency="1"> 27 <textures> 28 <texture file="structural/celt_struct_1.dds" name="baseTex"/> 29 </textures> 30 </variant> 31 <variant name="winter"> 32 <textures> 33 <texture file="structural/celt_struct_1_snow.dds" name="baseTex"/> 34 </textures> 35 </variant> 36 </group> 37 <group> 27 38 <variant frequency="100" name="Idle"/> 28 39 <variant name="garrisoned"> 29 40 <props> -
binaries/data/mods/public/art/actors/structures/iberians/fireship.xml
2 2 <actor version="1"> 3 3 <castshadow/> 4 4 <group> 5 <variant frequency="1" name=" firea">5 <variant frequency="1" name="base"> 6 6 <mesh>structural/iber_fireship.dae</mesh> 7 7 <props> 8 8 <prop actor="props/structures/iberians/fireship_wood.xml" attachpoint="root"/> 9 <prop actor="particle/flame_med.xml" attachpoint="fire1"/> 10 <prop actor="particle/smoke_med.xml" attachpoint="fire1"/> 11 <prop actor="particle/flame.xml" attachpoint="fire2"/> 12 <prop actor="" attachpoint="fire3"/> 9 </props> 10 <textures><texture file="structural/iber_ship.dds" name="baseTex"/></textures> 11 </variant> 12 </group> 13 <group> 14 <variant name="healthy" frequency="1"> 15 <props> 16 <prop actor="particle/flame_jav.xml" attachpoint="fire1"/> 17 <prop actor="particle/smoke_jav.xml" attachpoint="fire1"/> 13 18 <prop actor="particle/flame_jav.xml" attachpoint="fire4"/> 14 19 <prop actor="particle/smoke_jav.xml" attachpoint="fire4"/> 15 <prop actor="particle/flame.xml" attachpoint="fire5"/>16 <prop actor="particle/smoke_catapult.xml" attachpoint="fire5"/>17 20 </props> 18 <textures><texture file="structural/iber_ship.dds" name="baseTex"/></textures>19 21 </variant> 20 <variant frequency="1" name="fireb"> 21 <mesh>structural/iber_fireship.dae</mesh> 22 <variant name="lightDamage"> 22 23 <props> 23 <prop actor="props/structures/iberians/fireship_wood.xml" attachpoint="root"/> 24 <prop actor="particle/flame_jav.xml" attachpoint="fire1"/> 24 <prop actor="particle/flame.xml" attachpoint="fire1"/> 25 25 <prop actor="particle/smoke.xml" attachpoint="fire1"/> 26 <prop actor="particle/flame.xml" attachpoint="fire2"/> 27 <prop actor="particle/flame_med.xml" attachpoint="fire3"/> 28 <prop actor="particle/smoke_med.xml" attachpoint="fire3"/> 26 <prop actor="particle/flame_jav.xml" attachpoint="fire3"/> 27 <prop actor="particle/smoke_jav.xml" attachpoint="fire3"/> 28 <prop actor="particle/flame.xml" attachpoint="fire4"/> 29 <prop actor="particle/smoke_jav.xml" attachpoint="fire4"/> 30 </props> 31 </variant> 32 <variant name="mediumDamage"> 33 <props> 34 <prop actor="particle/flame.xml" attachpoint="fire1"/> 35 <prop actor="particle/smoke.xml" attachpoint="fire1"/> 36 <prop actor="particle/flame_jav.xml" attachpoint="fire2"/> 37 <prop actor="particle/flame.xml" attachpoint="fire3"/> 38 <prop actor="particle/smoke.xml" attachpoint="fire3"/> 39 <prop actor="particle/flame.xml" attachpoint="fire4"/> 40 <prop actor="particle/smoke.xml" attachpoint="fire4"/> 29 41 <prop actor="particle/flame_jav.xml" attachpoint="fire5"/> 30 <prop actor="particle/smoke_jav.xml" attachpoint="fire5"/>31 42 </props> 32 <textures><texture file="structural/iber_ship.dds" name="baseTex"/></textures>33 43 </variant> 44 <variant name="heavyDamage"> 45 <props> 46 <prop actor="particle/flame_large.xml" attachpoint="fire1"/> 47 <prop actor="particle/smoke_med.xml" attachpoint="fire1"/> 48 <prop actor="particle/flame.xml" attachpoint="fire2"/> 49 <prop actor="particle/flame_large.xml" attachpoint="fire3"/> 50 <prop actor="particle/smoke.xml" attachpoint="fire3"/> 51 <prop actor="particle/flame.xml" attachpoint="fire4"/> 52 <prop actor="particle/flame_large.xml" attachpoint="fire4"/> 53 <prop actor="particle/smoke_med.xml" attachpoint="fire5"/> 54 </props> 55 </variant> 56 <variant name="death"> 57 </variant> 34 58 </group> 35 59 <material>player_trans.xml</material> 36 60 </actor> -
binaries/data/mods/public/maps/skirmishes/Northern
51 51 {} 52 52 ], 53 53 "Preview": "northern_island.png", 54 "RevealMap": false 54 "RevealMap": false, 55 "Season": "winter" 55 56 } 56 57 ]]></ScriptSettings> 57 58 <Entities> … … 6724 6725 </Entity> 6725 6726 </Entities> 6726 6727 <Paths/> 6727 </Scenario> 6728 No newline at end of file 6728 </Scenario> -
binaries/data/mods/public/simulation/components/SeasonManager.js
1 function SeasonManager() {} 2 3 SeasonManager.prototype.Schema = 4 "<a:component type='system'/><empty/>"; 5 6 SeasonManager.prototype.Init = function() 7 { 8 this.season = "summer"; 9 }; 10 11 SeasonManager.prototype.SetSeason = function(season) 12 { 13 this.season = season; 14 Engine.BroadcastMessage(MT_SeasonChanged, { "newSeason": season }); 15 }; 16 17 SeasonManager.prototype.GetSeason = function() 18 { 19 return this.season; 20 }; 21 22 23 Engine.RegisterSystemComponentType(IID_SeasonManager, "SeasonManager", SeasonManager); -
binaries/data/mods/public/simulation/components/VariantSelection.js
1 function VariantSelection() {} 2 3 VariantSelection.prototype.Schema = 4 "<a:example>" + 5 "<HealthVariants>" + 6 "<LightDamage>0.75</LightDamage>" + 7 "<MediumDamage>0.50</MediumDamage>" + 8 "<HeavyDamage>0.25</HeavyDamage>" + 9 "</HealthVariants>" + 10 "</a:example>" + 11 "<optional>" + 12 "<element name='HealthVariants'>" + 13 "<oneOrMore>" + 14 "<element>" + 15 "<anyName/>" + 16 "<data type='decimal'>" + 17 "<param name='minInclusive'>0</param>" + 18 "<param name='maxInclusive'>1</param>" + 19 "</data>" + 20 "</element>" + 21 "</oneOrMore>" + 22 "</element>" + 23 "</optional>"; 24 25 VariantSelection.prototype.Init = function() 26 { 27 this.currentSelection = { 28 "health": "healthy", 29 }; 30 }; 31 32 VariantSelection.prototype.OnSeasonChanged = function(msg) 33 { 34 let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); 35 if (cmpVisual) 36 cmpVisual.SetVariantSelection("season", msg.newSeason); 37 }; 38 39 VariantSelection.prototype.OnOwnershipChanged = function(msg) 40 { 41 if (msg.from != -1) 42 return; 43 let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); 44 let cmpSeasonManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_SeasonManager); 45 if (cmpVisual) 46 cmpVisual.SetVariantSelection("season", cmpSeasonManager.GetSeason()); 47 }; 48 49 VariantSelection.prototype.OnHealthChanged = function(msg) 50 { 51 if (!this.template || !this.template.HealthVariants) 52 return; 53 54 let cmpHealth = Engine.QueryInterface(this.entity, IID_Health); 55 if (!cmpHealth) 56 return; 57 58 let healthRatio = cmpHealth.GetHitpoints() / cmpHealth.GetMaxHitpoints(); 59 60 let oldSelection = this.currentSelection.health 61 if (healthRatio > 0) 62 { 63 this.currentSelection.health = "healthy"; 64 for (let key in this.template.HealthVariants) 65 { 66 if (+this.template.HealthVariants[key] < healthRatio) 67 continue; 68 if (this.currentSelection.health == "healthy" || 69 +this.template.HealthVariants[key] < +this.template.HealthVariants[this.currentSelection]) 70 this.currentSelection.health = key; 71 } 72 } 73 else 74 this.currentSelection.health = "death" 75 76 if (oldSelection == this.currentSelection.health) 77 return; 78 let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); 79 if (cmpVisual) 80 cmpVisual.SetVariantSelection("health", this.currentSelection.health); 81 82 }; 83 84 Engine.RegisterComponentType(IID_VariantSelection, "VariantSelection", VariantSelection); 85 -
binaries/data/mods/public/simulation/components/interfaces/SeasonManager.js
1 Engine.RegisterInterface("SeasonManager"); 2 Engine.RegisterMessageType("SeasonChanged"); -
binaries/data/mods/public/simulation/components/interfaces/VariantSelection.js
1 Engine.RegisterInterface("VariantSelection"); 2 -
binaries/data/mods/public/simulation/helpers/InitGame.js
42 42 cmpRangeManager.ExploreAllTiles(i); 43 43 } 44 44 45 if (settings.Season) 46 { 47 let cmpSeasonManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_SeasonManager); 48 cmpSeasonManager.SetSeason(settings.Season); 49 } 50 45 51 // Sandbox, Very Easy, Easy, Medium, Hard, Very Hard 46 52 let rate = [ 0.50, 0.64, 0.80, 1.00, 1.25, 1.56 ]; 47 53 let cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager); -
binaries/data/mods/public/simulation/templates/structures/gaul_civil_centre.xml
22 22 units/{civ}_cavalry_javelinist_b 23 23 </Entities> 24 24 </ProductionQueue> 25 <VariantSelection/> 25 26 <VisualActor> 26 27 <Actor>structures/gauls/civic_centre.xml</Actor> 27 28 </VisualActor> -
binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_fire.xml
30 30 <Max>500</Max> 31 31 <RegenRate>-3</RegenRate> 32 32 </Health> 33 <VariantSelection> 34 <HealthVariants> 35 <lightdamage>0.85</lightdamage> 36 <mediumdamage>0.65</mediumdamage> 37 <heavydamage>0.35</heavydamage> 38 </HealthVariants> 39 </VariantSelection> 33 40 <Identity> 34 41 <GenericName>Fire Ship</GenericName> 35 42 <Classes datatype="tokens">Warship Fireship Melee</Classes>