Index: binaries/data/mods/public/maps/scenarios/combat_demo.xml
===================================================================
--- binaries/data/mods/public/maps/scenarios/combat_demo.xml
+++ binaries/data/mods/public/maps/scenarios/combat_demo.xml
@@ -3,462 +3,68 @@
cirrus
-
+
+
+ 0
+ 0.5
+
+
lake
+
34.623
- 3.0
+ 3
0.898438
-
+ 0
+
+ 0
+ 1
+ 0.99
+ 0.1999
+ default
+
-
-
-
+
+
+
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/athen/infantry_spearman_e
- 1
-
-
-
-
- units/athen/infantry_spearman_e
- 1
-
-
-
-
- units/athen/infantry_spearman_e
- 1
-
-
-
-
- units/athen/infantry_spearman_e
- 1
-
-
-
-
- units/athen/infantry_spearman_e
- 1
-
-
-
-
- units/athen/infantry_spearman_e
- 1
-
-
-
-
- units/athen/infantry_spearman_e
- 1
-
-
-
-
- units/athen/infantry_spearman_e
- 1
-
-
-
-
- units/athen/infantry_spearman_e
- 1
-
-
-
-
- units/athen/infantry_spearman_e
- 1
-
-
-
-
- units/athen/infantry_marine_archer_b
- 2
-
-
-
-
- units/athen/infantry_marine_archer_b
- 2
-
-
-
-
- units/athen/infantry_marine_archer_b
- 2
-
-
-
-
- units/athen/infantry_marine_archer_b
- 2
-
-
-
-
- units/athen/infantry_marine_archer_b
- 2
-
-
-
-
- units/athen/infantry_javelineer_a
- 2
-
-
-
-
- units/athen/infantry_javelineer_a
- 2
-
-
-
-
- units/athen/infantry_javelineer_a
- 2
-
-
-
-
- units/athen/infantry_javelineer_a
- 2
-
-
-
-
- units/athen/infantry_javelineer_a
- 2
-
-
-
-
- units/athen/infantry_javelineer_e
- 2
-
-
-
-
- units/athen/infantry_javelineer_e
- 2
-
-
-
-
- units/athen/infantry_javelineer_e
- 2
-
-
-
-
- units/athen/infantry_javelineer_e
- 2
-
-
-
-
- units/athen/infantry_spearman_b
- 2
-
-
-
-
- units/athen/infantry_spearman_b
- 2
-
-
-
-
- units/athen/infantry_spearman_b
- 2
-
-
-
-
- units/athen/infantry_spearman_b
- 2
-
-
-
-
- units/athen/infantry_spearman_b
- 2
-
-
-
-
- units/athen/infantry_spearman_b
- 2
-
-
-
-
- units/athen/infantry_spearman_b
- 2
-
-
-
-
- units/athen/infantry_spearman_b
- 2
-
-
-
-
- units/athen/infantry_spearman_b
- 2
-
-
-
-
- units/athen/infantry_spearman_b
- 2
-
-
-
-
- units/athen/champion_ranged
- 1
-
-
-
-
- units/athen/champion_ranged
- 1
-
-
-
-
- units/athen/champion_ranged
- 1
-
-
-
-
- units/athen/champion_ranged
- 1
-
-
-
-
- units/athen/champion_infantry
- 1
-
-
-
-
- units/athen/champion_infantry
- 1
-
-
-
-
- units/athen/champion_infantry
- 1
-
-
-
-
- units/athen/champion_infantry
- 1
-
-
-
-
- units/mace/champion_infantry_spearman_02
- 2
-
-
-
-
- units/mace/champion_infantry_spearman_02
- 2
-
-
-
-
- units/mace/champion_infantry_spearman_02
- 2
-
-
-
-
- units/mace/champion_infantry_spearman_02
- 2
-
-
-
-
- units/mace/champion_infantry_spearman_02
- 2
-
-
-
-
- units/athen/infantry_spearman_e
- 2
-
-
-
-
- units/athen/infantry_spearman_e
- 2
-
-
-
-
- units/athen/infantry_spearman_e
- 2
-
-
-
-
- units/athen/infantry_spearman_e
- 2
-
-
-
-
- units/athen/infantry_spearman_e
- 2
-
-
-
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/athen/infantry_marine_archer_e
- 1
-
-
-
-
- units/thebes_sacred_band_hoplitai
- 2
-
-
-
-
- units/thebes_sacred_band_hoplitai
- 2
-
-
-
-
- units/thebes_sacred_band_hoplitai
- 2
-
-
-
-
- units/thebes_sacred_band_hoplitai
- 2
-
-
-
-
- units/thebes_sacred_band_hoplitai
- 2
-
-
-
actor|props/special/common/waypoint_flag_factions.xml
@@ -1284,6 +890,139 @@
+
+ units/athen/support_female_citizen
+ 1
+
+
+
+
+
+ units/athen/support_female_citizen
+ 1
+
+
+
+
+
+ units/athen/support_female_citizen
+ 1
+
+
+
+
+
+ units/athen/support_female_citizen
+ 1
+
+
+
+
+
+ units/athen/support_female_citizen
+ 1
+
+
+
+
+
+ units/athen/support_female_citizen
+ 1
+
+
+
+
+
+ units/athen/support_female_citizen
+ 1
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
+
+ units/maur/infantry_archer_a
+ 2
+
+
+
+
Index: binaries/data/mods/public/simulation/components/Visibility.js
===================================================================
--- binaries/data/mods/public/simulation/components/Visibility.js
+++ binaries/data/mods/public/simulation/components/Visibility.js
@@ -94,4 +94,49 @@
return this.alwaysVisible;
};
+Visibility.prototype.RevealForPlayer = function(player, time)
+{
+ // This is only called for attackers that aren't visible,
+ // so this is probably efficient enough.
+ let cmpPos = Engine.QueryInterface(this.entity, IID_Position);
+ if (!cmpPos || !cmpPos.IsInWorld())
+ return;
+ let beacon = Engine.AddEntity("los_beacons/los_reveal_10");
+ let cmpBeaconPos = Engine.QueryInterface(beacon, IID_Position);
+ let pos = cmpPos.GetPosition2D();
+ cmpBeaconPos.JumpTo(pos.x, pos.y);
+ let cmpBeaconOwner = Engine.QueryInterface(beacon, IID_Ownership);
+ cmpBeaconOwner.SetOwner(player);
+
+ let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
+ cmpTimer.SetTimeout(this.entity, IID_Visibility, "DestroyBeacon", time, { "beacon": beacon });
+};
+
+Visibility.prototype.DestroyBeacon = function(data)
+{
+ if (data.beacon)
+ Engine.DestroyEntity(data.beacon);
+};
+
+// TODO: this should be in Vision, but that requires moving Vision to JS.
+Visibility.prototype.OnAttacked = function(msg)
+{
+ if (!msg.attacker)
+ return;
+
+ let cmpAttackerVisibility = Engine.QueryInterface(msg.attacker, IID_Visibility);
+ if (!cmpAttackerVisibility)
+ return;
+
+ let cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership);
+ if (!cmpOwnership)
+ return;
+
+ let cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
+ if (cmpRangeManager.GetLosVisibility(msg.attacker, cmpOwnership.GetOwner()) === "visible")
+ return;
+
+ cmpAttackerVisibility.RevealForPlayer(cmpOwnership.GetOwner(), 3000);
+};
+
Engine.RegisterComponentType(IID_Visibility, "Visibility", Visibility);
Index: binaries/data/mods/public/simulation/templates/los_beacons/los_reveal_10.xml
===================================================================
--- /dev/null
+++ binaries/data/mods/public/simulation/templates/los_beacons/los_reveal_10.xml
@@ -0,0 +1,6 @@
+
+
+
+ 10
+
+
Index: binaries/data/mods/public/simulation/templates/template_los_beacon.xml
===================================================================
--- /dev/null
+++ binaries/data/mods/public/simulation/templates/template_los_beacon.xml
@@ -0,0 +1,33 @@
+
+
+
+
+ 0
+ upright
+ false
+ 0
+ 6
+
+
+
+
+
+ 128x128/octagram.png
+ 128x128/octagram_mask.png
+
+
+
+
+ true
+ false
+ false
+ false
+
+
+
+ false
+ true
+ props/special/common/waypoint_flag.xml
+ true
+
+