Ticket #4595: debug_output.patch
File debug_output.patch, 3.6 KB (added by , 7 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Attack.js
Attack.prototype.PerformAttack = functio 538 538 data.radius = +this.template.Ranged.Splash.Range; 539 539 data.shape = this.template.Ranged.Splash.Shape; 540 540 data.isSplash = true; 541 541 data.splashStrengths = this.GetAttackStrengths(type+".Splash"); 542 542 } 543 warn("SetTimeout MissileHit " + data.target + " with " + Engine.QueryInterface(data.target, IID_Health).GetHitpoints() + "HP"); 543 544 cmpTimer.SetTimeout(SYSTEM_ENTITY, IID_Damage, "MissileHit", timeToTarget * 1000, data); 544 545 } 545 546 else if (type == "Capture") 546 547 { 547 548 if (attackerOwner == -1) -
binaries/data/mods/public/simulation/components/Health.js
Health.prototype.CheckRegenTimer = funct 186 186 this.regenTimer = cmpTimer.SetInterval(this.entity, IID_Health, "ExecuteRegeneration", 1000, 1000, null); 187 187 }; 188 188 189 189 Health.prototype.Kill = function() 190 190 { 191 warn("Health.Kill " + this.entity); 191 192 this.Reduce(this.hitpoints); 192 193 }; 193 194 194 195 /** 195 196 * Reduces entity's health by amount HP. 196 197 * Returns object of the form { "killed": false, "change": -12 } 197 198 */ 198 199 Health.prototype.Reduce = function(amount) 199 200 { 201 warn("Health.Reduce " + this.entity + " amount " + amount + " to " + Math.max(0, this.hitpoints - amount) + "HP"); 202 200 203 // Before changing the value, activate Fogging if necessary to hide changes 201 204 let cmpFogging = Engine.QueryInterface(this.entity, IID_Fogging); 202 205 if (cmpFogging) 203 206 cmpFogging.Activate(); 204 207 … … Health.prototype.Reduce = function(amoun 225 228 if(this.template.SpawnEntityOnDeath) 226 229 this.CreateDeathSpawnedEntity(); 227 230 228 231 if (this.template.DeathType == "corpse") 229 232 { 233 warn("Health.Reduce creates corpse and deletes entity " + this.entity) 230 234 this.CreateCorpse(); 231 235 Engine.DestroyEntity(this.entity); 232 236 } 233 237 else if (this.template.DeathType == "vanish") 234 238 { -
binaries/data/mods/public/simulation/components/Promotion.js
Promotion.prototype.GetPromotedTemplateN 30 30 31 31 Promotion.prototype.Promote = function(promotedTemplateName) 32 32 { 33 33 // If the unit is dead, don't promote it 34 34 var cmpCurrentUnitHealth = Engine.QueryInterface(this.entity, IID_Health); 35 warn("Promoting " + this.entity + " having " + cmpCurrentUnitHealth.GetHitpoints() + "HP"); 35 36 if (cmpCurrentUnitHealth.GetHitpoints() == 0) 36 37 return; 37 38 38 39 // Create promoted unit entity 39 40 var promotedUnitEntity = Engine.AddEntity(promotedTemplateName); … … Promotion.prototype.Promote = function(p 118 119 cmpUnitAI.SetGuardOf(promotedUnitEntity); 119 120 } 120 121 } 121 122 } 122 123 124 warn("MT_EntityRenamed " + this.entity + " to " + promotedUnitEntity); 123 125 Engine.BroadcastMessage(MT_EntityRenamed, { entity: this.entity, newentity: promotedUnitEntity }); 124 126 125 127 // Destroy current entity 128 warn("Destroy entity "+ this.entity + " due to promotion"); 126 129 Engine.DestroyEntity(this.entity); 130 warn("Destroyed entity "+ this.entity + " due to promotion"); 131 127 132 // save the entity id 128 133 this.promotedUnitEntity = promotedUnitEntity; 129 134 }; 130 135 131 136 Promotion.prototype.IncreaseXp = function(amount)