/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */ 704 %{ #include "StdH.h" #include "EntitiesMP/Common/PathFinding.h" #define MAX_TARGETS 6 %} uses "EntitiesMP/Marker"; %{ // info structure static EntityInfo eiMarker = { EIBT_ROCK, 10.0f, 0.0f, 1.0f, 0.0f, // source (eyes) 0.0f, 1.0f, 0.0f, // target (body) }; %} class export CNavigationMarker : CEntity { name "NavigationMarker"; thumbnail "Thumbnails\\NavigationMarker.tbn"; features "HasName", "IsTargetable"; properties: 1 CTString m_strName "Name" 'N' = "Marker", 2 RANGE m_fMarkerRange "Marker Range" 'M' = 1.0f, // range around marker (marker doesn't have to be hit directly) 100 CEntityPointer m_penTarget0 "Target 0" 'T' COLOR(C_dBLUE|0xFF), 101 CEntityPointer m_penTarget1 "Target 1" COLOR(C_dBLUE|0xFF), 102 CEntityPointer m_penTarget2 "Target 2" COLOR(C_dBLUE|0xFF), 103 CEntityPointer m_penTarget3 "Target 3" COLOR(C_dBLUE|0xFF), 104 CEntityPointer m_penTarget4 "Target 4" COLOR(C_dBLUE|0xFF), 105 CEntityPointer m_penTarget5 "Target 5" COLOR(C_dBLUE|0xFF), { CPathNode *m_ppnNode; // for pathfinding algorithm } components: 1 model MODEL_MARKER "Models\\Editor\\NavigationMarker.mdl", 2 texture TEXTURE_MARKER "Models\\Editor\\NavigationMarker.tex" functions: void CNavigationMarker(void) { m_ppnNode = NULL; } void ~CNavigationMarker(void) { ASSERT(m_ppnNode == NULL); } /* Read from stream. */ void Read_t( CTStream *istr) // throw char * { CEntity::Read_t(istr); m_ppnNode = NULL; } CEntity *GetTarget(void) const { return m_penTarget0; }; /* Entity info */ void *GetEntityInfo(void) { return &eiMarker; }; // get node used for pathfinding algorithm CPathNode *GetPathNode(void) { if (m_ppnNode==NULL) { m_ppnNode = new CPathNode(this); } return m_ppnNode; } CEntityPointer &TargetPointer(INDEX i) { ASSERT(i>=0 && iStretchModel(FLOAT3D(fSize, fSize, fSize)); SetModel(MODEL_MARKER); ModelChangeNotify(); SetModelMainTexture(TEXTURE_MARKER); // for each non-empty target for (INDEX iTarget=0; iTarget