mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Test mission to test HIT event handling of target units
This commit is contained in:
parent
9354e23630
commit
894854440b
@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20170308_2000' )
|
env.info( 'Moose Generation Timestamp: 20170308_2035' )
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
Include = {}
|
Include = {}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20170308_2000' )
|
env.info( 'Moose Generation Timestamp: 20170308_2035' )
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
Include = {}
|
Include = {}
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
-- Name: EVT-201 - GROUP OnEventHit Example
|
||||||
|
-- Author: FlightControl
|
||||||
|
-- Date Created: 08 Mar 2017
|
||||||
|
--
|
||||||
|
-- # Situation:
|
||||||
|
--
|
||||||
|
-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets.
|
||||||
|
--
|
||||||
|
-- # Test cases:
|
||||||
|
--
|
||||||
|
-- 1. Observe the planes shooting the missile.
|
||||||
|
-- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging.
|
||||||
|
-- 3. Check the contents of the fields of the S_EVENT_HIT entry.
|
||||||
|
-- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit.
|
||||||
|
-- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit.
|
||||||
|
|
||||||
|
local TanksGroup = GROUP:FindByName( "Group Tanks A" )
|
||||||
|
|
||||||
|
TanksGroup:HandleEvent( EVENTS.Hit )
|
||||||
|
|
||||||
|
function TanksGroup:OnEventHit( EventData )
|
||||||
|
|
||||||
|
self:E( "I just got hit and I am part of " .. EventData.TgtGroupName )
|
||||||
|
EventData.TgtUnit:MessageToAll( "I just got hit and I am part of " .. EventData.TgtGroupName, 15, "Alert!" )
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user