[Gcblue-commits] gcb_wx/scripts AI.py,1.14,1.15 UnitCommands.py,1.12,1.13
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-12-11 01:09:51
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30338/scripts Modified Files: AI.py UnitCommands.py Log Message: Sonar work, passive sonar, torpedoes Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AI.py 6 Nov 2004 15:13:40 -0000 1.14 --- AI.py 11 Dec 2004 01:09:06 -0000 1.15 *************** *** 413,416 **** --- 413,422 ---- return + # if sub, check launch depth requirements + adjust_depth = 0 + if (UI.IsSub()): + if (-UI.GetAlt() > launcher_info.MaxDepth_m): + adjust_depth = 1 + # use weapon if in range *************** *** 419,424 **** if (targetrange > launch_range): TTI = UI.SetHeadingToInterceptTarget() ! UI.SetSpeedToMax() UI.SetActionText('Int %d (%3.0f s)' % (targetid, TTI)) else: target_is_engaged = UI.GetVar(0) # engagement status stored in user var 0 --- 425,435 ---- if (targetrange > launch_range): TTI = UI.SetHeadingToInterceptTarget() ! if (UI.IsSub()): ! SetFractionalSpeed(UI, 0.5) ! else: ! UI.SetSpeedToMax() UI.SetActionText('Int %d (%3.0f s)' % (targetid, TTI)) + elif (adjust_depth): + UI.SetAlt(-launcher_info.MaxDepth_m + 1) else: target_is_engaged = UI.GetVar(0) # engagement status stored in user var 0 Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** UnitCommands.py 2 Dec 2004 04:17:24 -0000 1.12 --- UnitCommands.py 11 Dec 2004 01:09:06 -0000 1.13 *************** *** 56,59 **** --- 56,66 ---- UI.Launch(launcher_num, 1) + def SetDatum(UI, lon, lat, launcher_num): + datum_alt = UI.GetMapTerrainElevation(lon, lat) + if (datum_alt < 5.0): + datum_alt = 0.0 + UI.SendDatumToLauncher(lon,lat,datum_alt + 5.0,launcher_num) + + def TargetAndEngageWith(UI, target_id, launcher): UI.SetTarget(target_id) |