Changeset 25090
- Timestamp:
- Mar 20, 2021, 5:14:35 PM (3 years ago)
- Location:
- ps/trunk/binaries/data/mods/public/simulation/components
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/binaries/data/mods/public/simulation/components/Fogging.js
r24447 r25090 8 8 "<a:help>Allows this entity to be replaced by mirage entities in the fog-of-war.</a:help>" + 9 9 "<empty/>"; 10 11 12 13 14 15 16 17 18 19 20 21 22 23 10 24 11 25 Fogging.prototype.Init = function() … … 107 121 108 122 // Store valuable information into the mirage component (especially for the GUI). 109 let cmpIdentity = Engine.QueryInterface(this.entity, IID_Identity); 110 if (cmpIdentity) 111 cmpMirage.CopyIdentity(cmpIdentity); 112 113 let cmpFoundation = Engine.QueryInterface(this.entity, IID_Foundation); 114 if (cmpFoundation) 115 cmpMirage.CopyFoundation(cmpFoundation); 116 117 let cmpRepairable = Engine.QueryInterface(this.entity, IID_Repairable); 118 if (cmpRepairable && !cmpFoundation) 119 cmpMirage.CopyRepairable(cmpRepairable); 120 121 let cmpHealth = Engine.QueryInterface(this.entity, IID_Health); 122 if (cmpHealth) 123 cmpMirage.CopyHealth(cmpHealth); 124 125 let cmpCapturable = Engine.QueryInterface(this.entity, IID_Capturable); 126 if (cmpCapturable) 127 cmpMirage.CopyCapturable(cmpCapturable); 128 129 let cmpResourceSupply = Engine.QueryInterface(this.entity, IID_ResourceSupply); 130 if (cmpResourceSupply) 131 cmpMirage.CopyResourceSupply(cmpResourceSupply); 132 133 let cmpMarket = Engine.QueryInterface(this.entity, IID_Market); 134 if (cmpMarket) 135 cmpMirage.CopyMarket(cmpMarket); 123 for (let component of this.componentsToMirage) 124 cmpMirage.CopyComponent(component); 136 125 137 126 // Notify the GUI the entity has been replaced by a mirage, in case it is selected at this moment. -
ps/trunk/binaries/data/mods/public/simulation/components/Mirage.js
r25089 r25090 50 50 // Parent entity data 51 51 52 Mirage.prototype.CopyCapturable = function(cmpCapturable) 52 /** 53 * @param {number} iid - The component to mirage. 54 */ 55 Mirage.prototype.CopyComponent = function(iid) 53 56 { 54 this.miragedIids.set(IID_Capturable, cmpCapturable.Mirage()); 55 }; 56 57 Mirage.prototype.CopyFoundation = function(cmpFoundation) 58 { 59 this.miragedIids.set(IID_Foundation, cmpFoundation.Mirage()); 60 }; 61 62 Mirage.prototype.CopyHealth = function(cmpHealth) 63 { 64 this.miragedIids.set(IID_Health, cmpHealth.Mirage()); 65 }; 66 67 Mirage.prototype.CopyIdentity = function(cmpIdentity) 68 { 69 this.miragedIids.set(IID_Identity, cmpIdentity.Mirage()); 70 }; 71 72 Mirage.prototype.CopyMarket = function(cmpMarket) 73 { 74 this.miragedIids.set(IID_Market, cmpMarket.Mirage(this.entity, this.player)); 75 }; 76 77 Mirage.prototype.CopyRepairable = function(cmpRepairable) 78 { 79 this.miragedIids.set(IID_Repairable, cmpRepairable.Mirage()); 80 }; 81 82 Mirage.prototype.CopyResourceSupply = function(cmpResourceSupply) 83 { 84 this.miragedIids.set(IID_ResourceSupply, cmpResourceSupply.Mirage()); 57 let cmp = Engine.QueryInterface(this.parent, iid); 58 if (cmp) 59 this.miragedIids.set(iid, cmp.Mirage(this.entity, this.player)); 85 60 }; 86 61
Note:
See TracChangeset
for help on using the changeset viewer.