diff options
author | Aki <please@ignore.pl> | 2021-10-01 18:54:04 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2021-10-01 18:54:04 +0200 |
commit | b829170121d3657369904ec62d8065606777a9ce (patch) | |
tree | 0368594c82654a08ad563a3ae3a084357e987e71 /Doc/doxygen/html/_starship_tactical_a_i_8cpp_source.html | |
parent | 07f08477e85ab37957fddc4714d4706f13b2357a (diff) | |
download | starshatter-b829170121d3657369904ec62d8065606777a9ce.zip starshatter-b829170121d3657369904ec62d8065606777a9ce.tar.gz starshatter-b829170121d3657369904ec62d8065606777a9ce.tar.bz2 |
Removed doxygen generated docs
They can be rebuild anytime and are considered a build artifact/binary.
Diffstat (limited to 'Doc/doxygen/html/_starship_tactical_a_i_8cpp_source.html')
-rw-r--r-- | Doc/doxygen/html/_starship_tactical_a_i_8cpp_source.html | 393 |
1 files changed, 0 insertions, 393 deletions
diff --git a/Doc/doxygen/html/_starship_tactical_a_i_8cpp_source.html b/Doc/doxygen/html/_starship_tactical_a_i_8cpp_source.html deleted file mode 100644 index 75098f8..0000000 --- a/Doc/doxygen/html/_starship_tactical_a_i_8cpp_source.html +++ /dev/null @@ -1,393 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<meta http-equiv="X-UA-Compatible" content="IE=9"/> -<title>Starshatter_Open: D:/SRC/StarshatterSVN/Stars45/StarshipTacticalAI.cpp Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<script type="text/javascript" src="jquery.js"></script> -<script type="text/javascript" src="dynsections.js"></script> -<link href="navtree.css" rel="stylesheet" type="text/css"/> -<script type="text/javascript" src="resize.js"></script> -<script type="text/javascript" src="navtree.js"></script> -<script type="text/javascript"> - $(document).ready(initResizable); -</script> -<link href="search/search.css" rel="stylesheet" type="text/css"/> -<script type="text/javascript" src="search/search.js"></script> -<script type="text/javascript"> - $(document).ready(function() { searchBox.OnSelectItem(0); }); -</script> -<link href="doxygen.css" rel="stylesheet" type="text/css" /> -</head> -<body> -<div id="top"><!-- do not remove this div, it is closed by doxygen! --> -<div id="titlearea"> -<table cellspacing="0" cellpadding="0"> - <tbody> - <tr style="height: 56px;"> - <td style="padding-left: 0.5em;"> - <div id="projectname">Starshatter_Open - </div> - <div id="projectbrief">Open source Starshatter engine</div> - </td> - </tr> - </tbody> -</table> -</div> -<!-- end header part --> -<!-- Generated by Doxygen 1.8.1 --> -<script type="text/javascript"> -var searchBox = new SearchBox("searchBox", "search",false,'Search'); -</script> - <div id="navrow1" class="tabs"> - <ul class="tablist"> - <li><a href="index.html"><span>Main Page</span></a></li> - <li><a href="annotated.html"><span>Classes</span></a></li> - <li class="current"><a href="files.html"><span>Files</span></a></li> - <li> - <div id="MSearchBox" class="MSearchBoxInactive"> - <span class="left"> - <img id="MSearchSelect" src="search/mag_sel.png" - onmouseover="return searchBox.OnSearchSelectShow()" - onmouseout="return searchBox.OnSearchSelectHide()" - alt=""/> - <input type="text" id="MSearchField" value="Search" accesskey="S" - onfocus="searchBox.OnSearchFieldFocus(true)" - onblur="searchBox.OnSearchFieldFocus(false)" - onkeyup="searchBox.OnSearchFieldChange(event)"/> - </span><span class="right"> - <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> - </span> - </div> - </li> - </ul> - </div> - <div id="navrow2" class="tabs2"> - <ul class="tablist"> - <li><a href="files.html"><span>File List</span></a></li> - <li><a href="globals.html"><span>File Members</span></a></li> - </ul> - </div> -</div><!-- top --> -<div id="side-nav" class="ui-resizable side-nav-resizable"> - <div id="nav-tree"> - <div id="nav-tree-contents"> - </div> - </div> - <div id="splitbar" style="-moz-user-select:none;" - class="ui-resizable-handle"> - </div> -</div> -<script type="text/javascript"> -$(document).ready(function(){initNavTree('_starship_tactical_a_i_8cpp.html','');}); -</script> -<div id="doc-content"> -<!-- window showing the filter options --> -<div id="MSearchSelectWindow" - onmouseover="return searchBox.OnSearchSelectShow()" - onmouseout="return searchBox.OnSearchSelectHide()" - onkeydown="return searchBox.OnSearchSelectKey(event)"> -<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Macros</a></div> - -<!-- iframe showing the search results (closed by default) --> -<div id="MSearchResultsWindow"> -<iframe src="javascript:void(0)" frameborder="0" - name="MSearchResults" id="MSearchResults"> -</iframe> -</div> - -<div class="header"> - <div class="headertitle"> -<div class="title">StarshipTacticalAI.cpp</div> </div> -</div><!--header--> -<div class="contents"> -<a href="_starship_tactical_a_i_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/* Project Starshatter 4.5</span></div> -<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> Destroyer Studios LLC</span></div> -<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> Copyright © 1997-2004. All Rights Reserved.</span></div> -<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"></span></div> -<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> SUBSYSTEM: Stars.exe</span></div> -<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> FILE: StarshipTacticalAI.cpp</span></div> -<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> AUTHOR: John DiCamillo</span></div> -<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"></span></div> -<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div> -<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> OVERVIEW</span></div> -<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> ========</span></div> -<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> Starship-specific mid-level (tactical) AI</span></div> -<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">*/</span></div> -<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div> -<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include "<a class="code" href="_mem_debug_8h.html">MemDebug.h</a>"</span></div> -<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include "<a class="code" href="_starship_tactical_a_i_8h.html">StarshipTacticalAI.h</a>"</span></div> -<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include "<a class="code" href="_ship_a_i_8h.html">ShipAI.h</a>"</span></div> -<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="_ship_8h.html">Ship.h</a>"</span></div> -<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include "<a class="code" href="_ship_design_8h.html">ShipDesign.h</a>"</span></div> -<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "<a class="code" href="_shot_8h.html">Shot.h</a>"</span></div> -<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="_element_8h.html">Element.h</a>"</span></div> -<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include "<a class="code" href="_instruction_8h.html">Instruction.h</a>"</span></div> -<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include "<a class="code" href="_radio_message_8h.html">RadioMessage.h</a>"</span></div> -<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include "<a class="code" href="_radio_traffic_8h.html">RadioTraffic.h</a>"</span></div> -<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="_contact_8h.html">Contact.h</a>"</span></div> -<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "<a class="code" href="_weapon_group_8h.html">WeaponGroup.h</a>"</span></div> -<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="_drive_8h.html">Drive.h</a>"</span></div> -<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "<a class="code" href="_quantum_drive_8h.html">QuantumDrive.h</a>"</span></div> -<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="_sim_8h.html">Sim.h</a>"</span></div> -<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include "<a class="code" href="_star_system_8h.html">StarSystem.h</a>"</span></div> -<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include "<a class="code" href="_starshatter_8h.html">Starshatter.h</a>"</span></div> -<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include "<a class="code" href="_random_8h.html">Random.h</a>"</span></div> -<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div> -<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include "<a class="code" href="_game_8h.html">Game.h</a>"</span></div> -<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div> -<div class="line"><a name="l00036"></a><span class="lineno"><a class="code" href="_starship_tactical_a_i_8cpp.html#aecb9254205017ae929dbdb7070b89214"> 36</a></span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="_starship_tactical_a_i_8cpp.html#aecb9254205017ae929dbdb7070b89214">STARSHIP_TACTICAL_DROP_TIME</a> = 15;</div> -<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div> -<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// +----------------------------------------------------------------------+</span></div> -<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div> -<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="class_starship_tactical_a_i.html#a170f8c6363b69e5c9b2510f42fd5d551"> 40</a></span> <a class="code" href="class_starship_tactical_a_i.html#a170f8c6363b69e5c9b2510f42fd5d551">StarshipTacticalAI::StarshipTacticalAI</a>(<a class="code" href="class_ship_a_i.html">ShipAI</a>* ai)</div> -<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> : <a class="code" href="class_tactical_a_i.html">TacticalAI</a>(ai), drop_time(1.0e9), bugout(false), ai_level(0), initial_integrity(0)</div> -<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> {</div> -<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="keywordflow">if</span> (ai && ai-><a class="code" href="class_ship_a_i.html#a670f1939787d67957dbda57d2bc1c4a1">GetShip</a>()) {</div> -<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <a class="code" href="class_starship_tactical_a_i.html#a6bd03d4a27e2d33fed7e7a1b637c9808">ai_level</a> = ai-><a class="code" href="class_ship_a_i.html#ad611086929467a18546a61c88432f77e">GetAILevel</a>();</div> -<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <a class="code" href="class_starship_tactical_a_i.html#a637aaa9279ca0efc100a2f9d0791c049">initial_integrity</a> = ai-><a class="code" href="class_ship_a_i.html#a670f1939787d67957dbda57d2bc1c4a1">GetShip</a>()-><a class="code" href="class_physical.html#ad665e179e85f6d2f19536cf54b7f03a5">Integrity</a>();</div> -<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  }</div> -<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> </div> -<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keywordflow">switch</span> (<a class="code" href="class_starship_tactical_a_i.html#a6bd03d4a27e2d33fed7e7a1b637c9808">ai_level</a>) {</div> -<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keywordflow">default</span>:</div> -<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordflow">case</span> 2: <a class="code" href="class_starship_tactical_a_i.html#a8a36a6d63c148ff0c886262e13c7930e">THREAT_REACTION_TIME</a> = 500; <span class="keywordflow">break</span>;</div> -<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keywordflow">case</span> 1: <a class="code" href="class_starship_tactical_a_i.html#a8a36a6d63c148ff0c886262e13c7930e">THREAT_REACTION_TIME</a> = 1000; <span class="keywordflow">break</span>;</div> -<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keywordflow">case</span> 0: <a class="code" href="class_starship_tactical_a_i.html#a8a36a6d63c148ff0c886262e13c7930e">THREAT_REACTION_TIME</a> = 2500; </div> -<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <a class="code" href="class_starship_tactical_a_i.html#a77bc9eb01dadfa29b32c31784c7bf711">drop_time</a> = <a class="code" href="_starship_tactical_a_i_8cpp.html#aecb9254205017ae929dbdb7070b89214">STARSHIP_TACTICAL_DROP_TIME</a> +</div> -<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <a class="code" href="_random_8cpp.html#a93eaa94ec1af8703c6427ed5431ec61c">Random</a>(0, <a class="code" href="_starship_tactical_a_i_8cpp.html#aecb9254205017ae929dbdb7070b89214">STARSHIP_TACTICAL_DROP_TIME</a>);</div> -<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">break</span>;</div> -<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  }</div> -<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> }</div> -<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div> -<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> </div> -<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="comment">// +--------------------------------------------------------------------+</span></div> -<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div> -<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="class_starship_tactical_a_i.html#a869bb126c044267ccf4aa48b18319e91"> 62</a></span> <a class="code" href="class_starship_tactical_a_i.html#a869bb126c044267ccf4aa48b18319e91">StarshipTacticalAI::~StarshipTacticalAI</a>()</div> -<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> { }</div> -<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div> -<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment">// +--------------------------------------------------------------------+</span></div> -<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div> -<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="keywordtype">void</span></div> -<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="class_starship_tactical_a_i.html#a3058d1937fa70cab30b7adfee7d3a823"> 68</a></span> <a class="code" href="class_starship_tactical_a_i.html#a3058d1937fa70cab30b7adfee7d3a823">StarshipTacticalAI::ExecFrame</a>(<span class="keywordtype">double</span> seconds)</div> -<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> {</div> -<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <a class="code" href="class_starship_tactical_a_i.html#a3058d1937fa70cab30b7adfee7d3a823">TacticalAI::ExecFrame</a>(seconds);</div> -<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> </div> -<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <a class="code" href="class_starship_tactical_a_i.html#a77bc9eb01dadfa29b32c31784c7bf711">drop_time</a> -= seconds;</div> -<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div> -<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keywordflow">if</span> (<a class="code" href="class_starship_tactical_a_i.html#a77bc9eb01dadfa29b32c31784c7bf711">drop_time</a> <= 0) {</div> -<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <a class="code" href="class_starship_tactical_a_i.html#a77bc9eb01dadfa29b32c31784c7bf711">drop_time</a> = <a class="code" href="_starship_tactical_a_i_8cpp.html#aecb9254205017ae929dbdb7070b89214">STARSHIP_TACTICAL_DROP_TIME</a>;</div> -<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div> -<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <a class="code" href="class_tactical_a_i.html#adcd9f29e9794133dd26bdf12d899a783">ship_ai</a>-><a class="code" href="class_ship_a_i.html#a331f3a1b69595f8e768f9805f110453c">DropTarget</a>(<a class="code" href="_starship_tactical_a_i_8cpp.html#aecb9254205017ae929dbdb7070b89214">STARSHIP_TACTICAL_DROP_TIME</a>/4);</div> -<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  }</div> -<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> }</div> -<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div> -<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// +--------------------------------------------------------------------+</span></div> -<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> </div> -<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="keywordtype">void</span></div> -<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="class_starship_tactical_a_i.html#add9b7e66a08677006bd01c69703dc411"> 84</a></span> <a class="code" href="class_starship_tactical_a_i.html#add9b7e66a08677006bd01c69703dc411">StarshipTacticalAI::FindThreat</a>()</div> -<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> {</div> -<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="comment">// pick the closest contact on Threat Warning System:</span></div> -<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <a class="code" href="class_ship.html">Ship</a>* threat_ship = 0;</div> -<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <a class="code" href="class_shot.html">Shot</a>* threat_missile = 0;</div> -<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <a class="code" href="class_ship.html">Ship</a>* rumor = 0;</div> -<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keywordtype">double</span> threat_dist = 1e9;</div> -<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordtype">double</span> CELL_SIZE = 20e3;</div> -<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> </div> -<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <a class="code" href="class_tactical_a_i.html#a973e354734e093e9949f092761af286d">threat_level</a> = 0;</div> -<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <a class="code" href="class_tactical_a_i.html#a8fcfb0b1529086cc34ea7255e3ac65bf">support_level</a> = <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#af329ac19681d6dfe242c64c8c6160d67">AIValue</a>() / CELL_SIZE;</div> -<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div> -<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <a class="code" href="class_list_iter.html">ListIter<Contact></a> iter = <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a020ac1c3a07790d9f88eef601b08045d">ContactList</a>();</div> -<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div> -<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keywordflow">while</span> (++iter) {</div> -<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <a class="code" href="class_contact.html">Contact</a>* contact = iter.<a class="code" href="class_list_iter.html#a70cb1260924c01a38c4a68552120a5e0">value</a>();</div> -<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <a class="code" href="class_ship.html">Ship</a>* c_ship = contact-><a class="code" href="class_contact.html#ade86a4b0e979ca7f818da017d6eb58ae">GetShip</a>();</div> -<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <a class="code" href="class_shot.html">Shot</a>* c_shot = contact-><a class="code" href="class_contact.html#ac40d7d76c482daa7f6e2bad736889621">GetShot</a>();</div> -<div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div> -<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keywordflow">if</span> (!c_ship && !c_shot)</div> -<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">continue</span>;</div> -<div class="line"><a name="l00105"></a><span class="lineno"> 105</span> </div> -<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">if</span> (c_ship && c_ship != <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>) {</div> -<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordtype">double</span> basis = max(contact-><a class="code" href="class_contact.html#a35fb3b6072c8ab92b687a5e088a7241c">Range</a>(<a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>), CELL_SIZE);</div> -<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordtype">double</span> ai_value = c_ship-><a class="code" href="class_ship.html#af329ac19681d6dfe242c64c8c6160d67">AIValue</a>() / basis;</div> -<div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div> -<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordflow">if</span> (c_ship-><a class="code" href="class_ship.html#a5e603faf7321fb04d5b306d70ae6b9ca">GetIFF</a>() == <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a5e603faf7321fb04d5b306d70ae6b9ca">GetIFF</a>()) {</div> -<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <a class="code" href="class_tactical_a_i.html#a8fcfb0b1529086cc34ea7255e3ac65bf">support_level</a> += ai_value;</div> -<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  }</div> -<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a5e603faf7321fb04d5b306d70ae6b9ca">GetIFF</a>() > 0 && c_ship-><a class="code" href="class_ship.html#a5e603faf7321fb04d5b306d70ae6b9ca">GetIFF</a>() > 0) {</div> -<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <a class="code" href="class_tactical_a_i.html#a973e354734e093e9949f092761af286d">threat_level</a> += ai_value;</div> -<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  }</div> -<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (c_ship-><a class="code" href="class_ship.html#a5e603faf7321fb04d5b306d70ae6b9ca">GetIFF</a>() > 1) { <span class="comment">// neutrals should not be afraid of alliance</span></div> -<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <a class="code" href="class_tactical_a_i.html#a973e354734e093e9949f092761af286d">threat_level</a> += ai_value;</div> -<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  }</div> -<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  }</div> -<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> </div> -<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordflow">if</span> (contact-><a class="code" href="class_contact.html#a3cb519932405928550df6288767cf0c0">Threat</a>(<a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>) && </div> -<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  (<a class="code" href="class_game.html#ac76ba05e5da1ac16b84367e513e59466">Game::GameTime</a>() - contact-><a class="code" href="class_contact.html#af0fcebef02d93349d33835f334512577">AcquisitionTime</a>()) > <a class="code" href="class_starship_tactical_a_i.html#a8a36a6d63c148ff0c886262e13c7930e">THREAT_REACTION_TIME</a>) {</div> -<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> </div> -<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keywordflow">if</span> (c_shot) {</div> -<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  threat_missile = c_shot;</div> -<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  rumor = (<a class="code" href="class_ship.html">Ship</a>* ) threat_missile-><a class="code" href="class_shot.html#a93a15e6e17e1745b1fb9bb898e288ea8">Owner</a>();</div> -<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  }</div> -<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keywordflow">else</span> {</div> -<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordtype">double</span> rng = contact-><a class="code" href="class_contact.html#a35fb3b6072c8ab92b687a5e088a7241c">Range</a>(<a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>);</div> -<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> </div> -<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordflow">if</span> (c_ship && </div> -<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  c_ship-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>() != <a class="code" href="class_ship.html#a71fbded084bb90d16f77d87b7eae5824a3f4241f828f8fb02dcc1f81c6284a4bc">Ship::FREIGHTER</a> &&</div> -<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  c_ship-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>() != <a class="code" href="class_ship.html#a71fbded084bb90d16f77d87b7eae5824a50a9fd6ea07163add869ecc7886b4f84">Ship::FARCASTER</a>) {</div> -<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> </div> -<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> </div> -<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordflow">if</span> (c_ship-><a class="code" href="class_ship.html#ad0397b8c42cb88edd44b252e1f27c430">GetTarget</a>() == <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>) {</div> -<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">if</span> (!threat_ship || c_ship-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>() > threat_ship-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>()) {</div> -<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  threat_ship = c_ship;</div> -<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  threat_dist = 0;</div> -<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  }</div> -<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  }</div> -<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rng < threat_dist) {</div> -<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  threat_ship = c_ship;</div> -<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  threat_dist = rng;</div> -<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  }</div> -<div class="line"><a name="l00146"></a><span class="lineno"> 146</span> </div> -<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <a class="code" href="class_starship_tactical_a_i.html#a17f32c847cb406fd0f967d6dce04761f">CheckBugOut</a>(c_ship, rng);</div> -<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  }</div> -<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  }</div> -<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  }</div> -<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  }</div> -<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> </div> -<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordflow">if</span> (rumor) {</div> -<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  iter.<a class="code" href="class_list_iter.html#ae851e8921d44ff7df1287fc06766d9c2">reset</a>();</div> -<div class="line"><a name="l00155"></a><span class="lineno"> 155</span> </div> -<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordflow">while</span> (++iter) {</div> -<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keywordflow">if</span> (iter-><a class="code" href="class_contact.html#ade86a4b0e979ca7f818da017d6eb58ae">GetShip</a>() == rumor) {</div> -<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  rumor = 0;</div> -<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <a class="code" href="class_tactical_a_i.html#adcd9f29e9794133dd26bdf12d899a783">ship_ai</a>-><a class="code" href="class_ship_a_i.html#aeaf81391c88ec457b13343f619443517">ClearRumor</a>();</div> -<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keywordflow">break</span>;</div> -<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  }</div> -<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  }</div> -<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  }</div> -<div class="line"><a name="l00164"></a><span class="lineno"> 164</span> </div> -<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <a class="code" href="class_tactical_a_i.html#adcd9f29e9794133dd26bdf12d899a783">ship_ai</a>-><a class="code" href="class_ship_a_i.html#a3cb24c044c10537d65aee93f19102b99">SetRumor</a>(rumor);</div> -<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <a class="code" href="class_tactical_a_i.html#adcd9f29e9794133dd26bdf12d899a783">ship_ai</a>-><a class="code" href="class_ship_a_i.html#aa31ae9ad2ec85b32ddfdd64d31da5e89">SetThreat</a>(threat_ship);</div> -<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <a class="code" href="class_tactical_a_i.html#adcd9f29e9794133dd26bdf12d899a783">ship_ai</a>-><a class="code" href="class_ship_a_i.html#af3d2bbe12e3410ac1a5bb0fca6247aa5">SetThreatMissile</a>(threat_missile);</div> -<div class="line"><a name="l00168"></a><span class="lineno"> 168</span> }</div> -<div class="line"><a name="l00169"></a><span class="lineno"> 169</span> </div> -<div class="line"><a name="l00170"></a><span class="lineno"> 170</span> <span class="comment">// +--------------------------------------------------------------------+</span></div> -<div class="line"><a name="l00171"></a><span class="lineno"> 171</span> </div> -<div class="line"><a name="l00172"></a><span class="lineno"> 172</span> <span class="keywordtype">void</span></div> -<div class="line"><a name="l00173"></a><span class="lineno"><a class="code" href="class_starship_tactical_a_i.html#a8cc2475bc4bb9ad5c5640763a7c35c2b"> 173</a></span> <a class="code" href="class_starship_tactical_a_i.html#a8cc2475bc4bb9ad5c5640763a7c35c2b">StarshipTacticalAI::FindSupport</a>()</div> -<div class="line"><a name="l00174"></a><span class="lineno"> 174</span> {</div> -<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="keywordflow">if</span> (<a class="code" href="class_tactical_a_i.html#a973e354734e093e9949f092761af286d">threat_level</a> < 0.01) {</div> -<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <a class="code" href="class_tactical_a_i.html#adcd9f29e9794133dd26bdf12d899a783">ship_ai</a>-><a class="code" href="class_ship_a_i.html#a9be07d35824e756755a4549efbf2ca00">SetSupport</a>(0);</div> -<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordflow">return</span>;</div> -<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  }</div> -<div class="line"><a name="l00179"></a><span class="lineno"> 179</span> </div> -<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="comment">// pick the biggest friendly contact in the sector:</span></div> -<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <a class="code" href="class_ship.html">Ship</a>* support = 0;</div> -<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="keywordtype">double</span> support_dist = 1e9;</div> -<div class="line"><a name="l00183"></a><span class="lineno"> 183</span> </div> -<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <a class="code" href="class_list_iter.html">ListIter<Contact></a> c_iter = <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a020ac1c3a07790d9f88eef601b08045d">ContactList</a>();</div> -<div class="line"><a name="l00185"></a><span class="lineno"> 185</span> </div> -<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keywordflow">while</span> (++c_iter) {</div> -<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <a class="code" href="class_contact.html">Contact</a>* contact = c_iter.<a class="code" href="class_list_iter.html#a70cb1260924c01a38c4a68552120a5e0">value</a>();</div> -<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keywordflow">if</span> (contact-><a class="code" href="class_contact.html#ade86a4b0e979ca7f818da017d6eb58ae">GetShip</a>() && contact-><a class="code" href="class_contact.html#a8d6b667fe8fb635b799091cad00d783f">GetIFF</a>(<a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>) == <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a5e603faf7321fb04d5b306d70ae6b9ca">GetIFF</a>()) {</div> -<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <a class="code" href="class_ship.html">Ship</a>* c_ship = contact-><a class="code" href="class_contact.html#ade86a4b0e979ca7f818da017d6eb58ae">GetShip</a>();</div> -<div class="line"><a name="l00190"></a><span class="lineno"> 190</span> </div> -<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keywordflow">if</span> (c_ship != <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a> && c_ship-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>() >= <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>()) {</div> -<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keywordflow">if</span> (!support || c_ship-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>() > support-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>())</div> -<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  support = c_ship;</div> -<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  }</div> -<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  }</div> -<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  }</div> -<div class="line"><a name="l00197"></a><span class="lineno"> 197</span> </div> -<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <a class="code" href="class_tactical_a_i.html#adcd9f29e9794133dd26bdf12d899a783">ship_ai</a>-><a class="code" href="class_ship_a_i.html#a9be07d35824e756755a4549efbf2ca00">SetSupport</a>(support);</div> -<div class="line"><a name="l00199"></a><span class="lineno"> 199</span> }</div> -<div class="line"><a name="l00200"></a><span class="lineno"> 200</span> </div> -<div class="line"><a name="l00201"></a><span class="lineno"> 201</span> <span class="keywordtype">void</span></div> -<div class="line"><a name="l00202"></a><span class="lineno"><a class="code" href="class_starship_tactical_a_i.html#a17f32c847cb406fd0f967d6dce04761f"> 202</a></span> <a class="code" href="class_starship_tactical_a_i.html#a17f32c847cb406fd0f967d6dce04761f">StarshipTacticalAI::CheckBugOut</a>(<a class="code" href="class_ship.html">Ship</a>* c_ship, <span class="keywordtype">double</span> rng)</div> -<div class="line"><a name="l00203"></a><span class="lineno"> 203</span> {</div> -<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="comment">// see if carrier should bug out...</span></div> -<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keywordflow">if</span> (!<a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a> || !c_ship || <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>() != <a class="code" href="class_ship.html#a71fbded084bb90d16f77d87b7eae5824a14733be3bf6b249a41d9a5a3994ccc09">Ship::CARRIER</a>)</div> -<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordflow">return</span>;</div> -<div class="line"><a name="l00207"></a><span class="lineno"> 207</span> </div> -<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keywordflow">if</span> (<a class="code" href="class_starship_tactical_a_i.html#a0b112b974cec15c1e43446cb9ed252ce">bugout</a>)</div> -<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keywordflow">return</span>;</div> -<div class="line"><a name="l00210"></a><span class="lineno"> 210</span> </div> -<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keywordflow">if</span> (<a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a791d746356184004b55fa8ad874ac31e">GetElement</a>() && <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a791d746356184004b55fa8ad874ac31e">GetElement</a>()-><a class="code" href="class_element.html#a79f571470208658bf7775fa4e5c16ec4">GetZoneLock</a>())</div> -<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <span class="keywordflow">return</span>;</div> -<div class="line"><a name="l00213"></a><span class="lineno"> 213</span> </div> -<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="keywordflow">if</span> (c_ship-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>() < <a class="code" href="class_ship.html#a71fbded084bb90d16f77d87b7eae5824ae666ac174daa6f1fd421d331507eb02a">Ship::DESTROYER</a> || c_ship-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>() > <a class="code" href="class_ship.html#a71fbded084bb90d16f77d87b7eae5824a4f6f1142524c01a8679946bd85c86a38">Ship::STATION</a>)</div> -<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="keywordflow">return</span>;</div> -<div class="line"><a name="l00216"></a><span class="lineno"> 216</span> </div> -<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <a class="code" href="class_starshatter.html">Starshatter</a>* stars = <a class="code" href="class_starshatter.html#ab1ac37871c2f5d17a1e346e3fc9f0ba6">Starshatter::GetInstance</a>();</div> -<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keywordflow">if</span> (stars && stars-><a class="code" href="class_starshatter.html#a7989759bf09a0f75e90938069f35db84">InCutscene</a>())</div> -<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordflow">return</span>;</div> -<div class="line"><a name="l00220"></a><span class="lineno"> 220</span> </div> -<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keywordtype">double</span> sustained_damage = <a class="code" href="class_starship_tactical_a_i.html#a637aaa9279ca0efc100a2f9d0791c049">initial_integrity</a> - <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_physical.html#ad665e179e85f6d2f19536cf54b7f03a5">Integrity</a>();</div> -<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordtype">double</span> allowable_damage = <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a6fd3887d24901d505be195335ff3b565">Design</a>()-><a class="code" href="class_ship_design.html#af112b5efa577088b7ccbde199c2bb535">integrity</a> * 0.25;</div> -<div class="line"><a name="l00223"></a><span class="lineno"> 223</span> </div> -<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">if</span> (rng > 50e3 && sustained_damage < allowable_damage)</div> -<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordflow">return</span>;</div> -<div class="line"><a name="l00226"></a><span class="lineno"> 226</span> </div> -<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="comment">// still here? we must need to bug out!</span></div> -<div class="line"><a name="l00228"></a><span class="lineno"> 228</span> </div> -<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <a class="code" href="class_sim.html">Sim</a>* sim = <a class="code" href="class_sim.html#a14b48a472bca6d04230c789fc4beab4c">Sim::GetSim</a>();</div> -<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <a class="code" href="class_sim_region.html">SimRegion</a>* dst = 0;</div> -<div class="line"><a name="l00231"></a><span class="lineno"> 231</span> </div> -<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <a class="code" href="class_list.html">List<SimRegion></a>& regions = sim-><a class="code" href="class_sim.html#a19e621db0c9f11474cc49dd733904f86">GetRegions</a>();</div> -<div class="line"><a name="l00233"></a><span class="lineno"> 233</span> </div> -<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="keywordflow">if</span> (regions.<a class="code" href="class_list.html#a802e2aa9aaef248591140fa032d20d61">size</a>() > 1) {</div> -<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keywordtype">int</span> tries = 10;</div> -<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="keywordflow">while</span> (!dst && tries--) {</div> -<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <span class="keywordtype">int</span> n = <a class="code" href="_random_8cpp.html#a12eb35acc9edaa81daf37984ca80e9ab">RandomIndex</a>() % regions.<a class="code" href="class_list.html#a802e2aa9aaef248591140fa032d20d61">size</a>();</div> -<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  dst = regions[n];</div> -<div class="line"><a name="l00239"></a><span class="lineno"> 239</span> </div> -<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <span class="keywordflow">if</span> (dst == <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_sim_object.html#aa15b8215840833436f14f22919cf01f5">GetRegion</a>() || dst-><a class="code" href="class_sim_region.html#a9a92c2ce7bbd53069df2ba2c2b535ba6">IsAirSpace</a>())</div> -<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  dst = 0;</div> -<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  }</div> -<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  }</div> -<div class="line"><a name="l00244"></a><span class="lineno"> 244</span> </div> -<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="keywordflow">if</span> (dst) {</div> -<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="comment">// bug out!</span></div> -<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <a class="code" href="class_quantum_drive.html">QuantumDrive</a>* quantum = <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a5e45166f4f0c6887b4bf90e881a67ef1">GetQuantumDrive</a>();</div> -<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keywordflow">if</span> (quantum) {</div> -<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  quantum-><a class="code" href="class_quantum_drive.html#aea07c4f55589b1f03439b2364ec518c4">SetDestination</a>(dst, <a class="code" href="struct_point.html">Point</a>(0,0,0));</div> -<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  quantum-><a class="code" href="class_quantum_drive.html#aab5b274e408fad677cd2f18d55e87cdd">Engage</a>();</div> -<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  }</div> -<div class="line"><a name="l00252"></a><span class="lineno"> 252</span> </div> -<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="comment">// ask highest ranking escort to go with you:</span></div> -<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <a class="code" href="class_element.html">Element</a>* escort = 0;</div> -<div class="line"><a name="l00255"></a><span class="lineno"> 255</span> </div> -<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <a class="code" href="class_list_iter.html">ListIter<Element></a> iter = sim-><a class="code" href="class_sim.html#acfbb732b454918e716bd7d090d8e2d9e">GetElements</a>();</div> -<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keywordflow">while</span> (++iter) {</div> -<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <a class="code" href="class_element.html">Element</a>* elem = iter.<a class="code" href="class_list_iter.html#a70cb1260924c01a38c4a68552120a5e0">value</a>();</div> -<div class="line"><a name="l00259"></a><span class="lineno"> 259</span> </div> -<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="keywordflow">if</span> (!escort || elem-><a class="code" href="class_element.html#aed0aafaf3838538d9eb13a0182705c49">GetShipClass</a>() > escort-><a class="code" href="class_element.html#aed0aafaf3838538d9eb13a0182705c49">GetShipClass</a>()) {</div> -<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <span class="keywordflow">if</span> (<a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>-><a class="code" href="class_ship.html#a791d746356184004b55fa8ad874ac31e">GetElement</a>()-><a class="code" href="class_element.html#ad420f3eb581b74dbb296963a23fefd7a">CanCommand</a>(elem))</div> -<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  escort = elem;</div> -<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  }</div> -<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  }</div> -<div class="line"><a name="l00265"></a><span class="lineno"> 265</span> </div> -<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="keywordflow">if</span> (escort) {</div> -<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <a class="code" href="class_radio_message.html">RadioMessage</a>* msg = <span class="keyword">new</span>(__FILE__,__LINE__) <a class="code" href="class_radio_message.html">RadioMessage</a>(escort, <a class="code" href="class_tactical_a_i.html#a0d7cad022cc27f13a367dee50a28ef78">ship</a>, <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25af8047234742ddbba04628ac968a51a27">RadioMessage::QUANTUM_TO</a>);</div> -<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="keywordflow">if</span> (msg) {</div> -<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  msg-><a class="code" href="class_radio_message.html#a00b635ed2120e445b13906e6e00d0ce3">SetInfo</a>(dst-><a class="code" href="class_sim_region.html#a4fb402a63782d520a25954ab9235b1bc">Name</a>());</div> -<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <a class="code" href="class_radio_traffic.html#a12650c86b7d95c5c92f779bc7e754c57">RadioTraffic::Transmit</a>(msg);</div> -<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  }</div> -<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  }</div> -<div class="line"><a name="l00273"></a><span class="lineno"> 273</span> </div> -<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  <a class="code" href="class_starship_tactical_a_i.html#a0b112b974cec15c1e43446cb9ed252ce">bugout</a> = <span class="keyword">true</span>;</div> -<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  }</div> -<div class="line"><a name="l00276"></a><span class="lineno"> 276</span> }</div> -</div><!-- fragment --></div><!-- contents --> -</div><!-- doc-content --> -<!-- start footer part --> -<div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> - <ul> - <li class="navelem"><a class="el" href="dir_ea1b58c809a5070716d7c602998a95b0.html">Stars45</a></li><li class="navelem"><a class="el" href="_starship_tactical_a_i_8cpp.html">StarshipTacticalAI.cpp</a></li> - <li class="footer">Generated on Tue Jun 5 2012 20:47:13 for Starshatter_Open by - <a href="http://www.doxygen.org/index.html"> - <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1 </li> - </ul> -</div> -</body> -</html> |