Property changes on: binaries/data
___________________________________________________________________
Modified: svn:ignore
## -1,3 +1,4 ##
-*.xmb
*.db
*.jbf
+*.xmb
+cache
|
|
|
94 | 94 | "<Crush>0.0</Crush>" + |
95 | 95 | "<MaxRange>4.0</MaxRange>" + |
96 | 96 | "</Slaughter>" + |
| 97 | "<Death>" + |
| 98 | "<Shape>Circular</Shape>" + |
| 99 | "<Range>20</Range>" + |
| 100 | "<FriendlyFire>false</FriendlyFire>" + |
| 101 | "<Hack>0.0</Hack>" + |
| 102 | "<Pierce>10.0</Pierce>" + |
| 103 | "<Crush>50.0</Crush>" + |
| 104 | "</Death>" + |
97 | 105 | "</a:example>" + |
98 | 106 | "<optional>" + |
99 | 107 | "<element name='Melee'>" + |
… |
… |
|
177 | 185 | Attack.prototype.restrictedClassesSchema + |
178 | 186 | "</interleave>" + |
179 | 187 | "</element>" + |
| 188 | "</optional>" + |
| 189 | "<optional>" + |
| 190 | "<element name='Death' a:help='When a unit dies it inflicts damage on nearby units.'>" + |
| 191 | "<interleave>" + |
| 192 | "<element name='Shape' a:help='Shape of the splash damage, can be circular or linear'><text/></element>" + |
| 193 | "<element name='Range' a:help='Size of the area affected by the splash'><ref name='nonNegativeDecimal'/></element>" + |
| 194 | "<element name='FriendlyFire' a:help='Whether the splash damage can hurt non enemy units'><data type='boolean'/></element>" + |
| 195 | "<element name='Hack' a:help='Hack damage strength'><ref name='nonNegativeDecimal'/></element>" + |
| 196 | "<element name='Pierce' a:help='Pierce damage strength'><ref name='nonNegativeDecimal'/></element>" + |
| 197 | "<element name='Crush' a:help='Crush damage strength'><ref name='nonNegativeDecimal'/></element>" + |
| 198 | Attack.prototype.bonusesSchema + |
| 199 | Attack.prototype.preferredClassesSchema + |
| 200 | Attack.prototype.restrictedClassesSchema + |
| 201 | "</interleave>" + |
| 202 | "</element>" + |
180 | 203 | "</optional>"; |
181 | 204 | |
182 | 205 | Attack.prototype.Init = function() |
… |
… |
|
545 | 568 | }; |
546 | 569 | if (this.template.Ranged.Splash) |
547 | 570 | { |
548 | | data.friendlyFire = this.template.Ranged.Splash.FriendlyFire; |
| 571 | data.friendlyFire = this.template.Ranged.Splash.FriendlyFire != "false"; |
549 | 572 | data.radius = +this.template.Ranged.Splash.Range; |
550 | 573 | data.shape = this.template.Ranged.Splash.Shape; |
551 | 574 | data.isSplash = true; |
… |
… |
|
605 | 628 | cmpUnitAI.UpdateRangeQueries(); |
606 | 629 | }; |
607 | 630 | |
| 631 | Attack.prototype.CauseDeathDamage = function() |
| 632 | { |
| 633 | if (!this.template.Death) |
| 634 | return; |
| 635 | |
| 636 | let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |
| 637 | if (!cmpPosition.IsInWorld()) |
| 638 | return; |
| 639 | |
| 640 | let pos = cmpPosition.GetPosition(); |
| 641 | let cmpDamage = Engine.QueryInterface(SYSTEM_ENTITY, IID_Damage); |
| 642 | let owner = Engine.QueryInterface(this.entity, IID_Ownership).GetOwner(); |
| 643 | let playersToDamage = cmpDamage.GetPlayersToDamage(this.template.Death.FriendlyFire, owner); |
| 644 | |
| 645 | cmpDamage.CauseSplashDamage({ |
| 646 | "attacker": this.entity, |
| 647 | "origin": Vector2D.from3D(pos), |
| 648 | "radius": this.template.Death.Range, |
| 649 | "shape": this.template.Death.Shape, |
| 650 | "strengths": this.GetAttackStrengths("Death"), |
| 651 | "direction": 0, //does directed death damage make sense? |
| 652 | "playersToDamage": playersToDamage, |
| 653 | "type": this.template.Type, |
| 654 | "attackerOwner": owner |
| 655 | }); |
| 656 | |
| 657 | }; |
| 658 | |
608 | 659 | Engine.RegisterComponentType(IID_Attack, "Attack", Attack); |