Ticket #3590: undeletable.diff
File undeletable.diff, 5.4 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/gui/session/unit_actions.js
691 691 "delete": { 692 692 "getInfo": function(entState) 693 693 { 694 if (!entState.canDelete) 695 return false; 696 694 697 if (entState.mirage) 695 698 return { 696 699 "tooltip": translate("You cannot destroy this entity because it is in the fog-of-war"), -
binaries/data/mods/public/simulation/components/GuiInterface.js
272 272 ret.maxHitpoints = cmpHealth.GetMaxHitpoints(); 273 273 ret.needsRepair = cmpHealth.IsRepairable() && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()); 274 274 ret.needsHeal = !cmpHealth.IsUnhealable(); 275 ret.canDelete = !cmpHealth.IsUndeletable(); 275 276 } 276 277 277 278 var cmpCapturable = QueryMiragedInterface(ent, IID_Capturable); -
binaries/data/mods/public/simulation/components/Health.js
30 30 "<value a:help='Remain in the world with 0 health'>remain</value>" + 31 31 "</choice>" + 32 32 "</element>" + 33 "<element name='Undeletable' a:help='Prevent players from deleting this entity.'>" + 34 "<data type='boolean'/>" + 35 "</element>" + 33 36 "<element name='Unhealable' a:help='Indicates that the entity can not be healed by healer units'>" + 34 37 "<data type='boolean'/>" + 35 38 "</element>"; … … 99 102 || this.GetHitpoints() >= this.GetMaxHitpoints()); 100 103 }; 101 104 105 Health.prototype.IsUndeletable = function() 106 { 107 return this.template.Undeletable == "true"; 108 }; 109 102 110 Health.prototype.GetRegenRate = function() 103 111 { 104 112 return this.regenRate; -
binaries/data/mods/public/simulation/components/Mirage.js
22 22 this.hitpoints = null; 23 23 this.repairable = null; 24 24 this.unhealable = null; 25 this.undeletable = null; 25 26 26 27 this.capturePoints = []; 27 28 this.maxCapturePoints = 0; … … 79 80 this.hitpoints = cmpHealth.GetHitpoints(); 80 81 this.repairable = cmpHealth.IsRepairable(); 81 82 this.unhealable = cmpHealth.IsUnhealable(); 83 this.undeletable = cmpHealth.IsUndeletable(); 82 84 }; 83 85 84 86 Mirage.prototype.GetMaxHitpoints = function() { return this.maxHitpoints; }; 85 87 Mirage.prototype.GetHitpoints = function() { return this.hitpoints; }; 86 88 Mirage.prototype.IsRepairable = function() { return this.repairable; }; 87 89 Mirage.prototype.IsUnhealable = function() { return this.unhealable; }; 90 Mirage.prototype.IsUndeletable = function() { return this.undeletable; }; 88 91 89 92 // Capture data 90 93 -
binaries/data/mods/public/simulation/helpers/Commands.js
366 366 var cmpHealth = Engine.QueryInterface(ent, IID_Health); 367 367 if (cmpHealth) 368 368 { 369 if (cmpHealth.IsUndeletable()) 370 continue; 369 371 var cmpResourceSupply = Engine.QueryInterface(ent, IID_ResourceSupply); 370 372 if (!cmpResourceSupply || !cmpResourceSupply.GetKillBeforeGather()) 371 373 cmpHealth.Kill(); -
binaries/data/mods/public/simulation/templates/template_structure.xml
47 47 <Health> 48 48 <DeathType>corpse</DeathType> 49 49 <RegenRate>0</RegenRate> 50 <Undeletable>false</Undeletable> 50 51 <Unhealable>true</Unhealable> 51 52 </Health> 52 53 <Repairable> -
binaries/data/mods/public/simulation/templates/template_structure_civic_civil_centre.xml
65 65 <Max>3000</Max> 66 66 <SpawnEntityOnDeath>rubble/rubble_stone_6x6</SpawnEntityOnDeath> 67 67 </Health> 68 68 <Identity> 69 69 <GenericName>Civic Center</GenericName> 70 70 <Tooltip>Build to acquire large tracts of territory. Train citizens. Garrison: 20.</Tooltip> 71 71 <Classes datatype="tokens"> -
binaries/data/mods/public/simulation/templates/template_unit.xml
31 31 <DeathType>corpse</DeathType> 32 32 <Max>100</Max> 33 33 <RegenRate>0</RegenRate> 34 <Undeletable>false</Undeletable> 34 35 <Unhealable>false</Unhealable> 35 36 </Health> 36 37 <Identity>