[Gcblue-commits] gcb_wx/scripts UnitCommands.py,1.34,1.35
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-12-28 23:44:21
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5680 Modified Files: UnitCommands.py Log Message: Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** UnitCommands.py 20 Dec 2006 00:45:46 -0000 1.34 --- UnitCommands.py 28 Dec 2006 23:44:19 -0000 1.35 *************** *** 494,497 **** --- 494,498 ---- # Group menu functions from Ben "Mnfe" 20061217 post + # Updated with 20061220 post def RelGroupSpeed100(GI): unit_count = GI.GetUnitCount() *************** *** 504,508 **** for n in range(0,unit_count): UI = GI.GetPlatformInterface(n) ! UI.SetSpeed(max_speed) def RelGroupSpeed80(GI): --- 505,513 ---- for n in range(0,unit_count): UI = GI.GetPlatformInterface(n) ! if(not UI.HasThrottle()): ! UI.SetSpeed(max_speed) ! else: ! this_speed=UI.GetMaxSpeed() ! UI.SetThrottle(max_speed/this_speed) def RelGroupSpeed80(GI): *************** *** 516,520 **** for n in range(0,unit_count): UI = GI.GetPlatformInterface(n) ! UI.SetSpeed(0.8*max_speed) def RelGroupSpeed50(GI): --- 521,529 ---- for n in range(0,unit_count): UI = GI.GetPlatformInterface(n) ! if(not UI.HasThrottle()): ! UI.SetSpeed(0.8*max_speed) ! else: ! this_speed=UI.GetMaxSpeed() ! UI.SetThrottle((0.8*max_speed)/this_speed) def RelGroupSpeed50(GI): *************** *** 528,532 **** for n in range(0,unit_count): UI = GI.GetPlatformInterface(n) ! UI.SetSpeed(0.5*max_speed) def RelGroupSpeed30(GI): --- 537,545 ---- for n in range(0,unit_count): UI = GI.GetPlatformInterface(n) ! if(not UI.HasThrottle()): ! UI.SetSpeed(0.5*max_speed) ! else: ! this_speed=UI.GetMaxSpeed() ! UI.SetThrottle((0.5*max_speed)/this_speed) def RelGroupSpeed30(GI): *************** *** 540,545 **** for n in range(0,unit_count): UI = GI.GetPlatformInterface(n) ! UI.SetSpeed(0.3*max_speed) ! def AddEngageAllOrderGroup(GI): unit_count=GI.GetUnitCount() --- 553,562 ---- for n in range(0,unit_count): UI = GI.GetPlatformInterface(n) ! if(not UI.HasThrottle()): ! UI.SetSpeed(0.3*max_speed) ! else: ! this_speed=UI.GetMaxSpeed() ! UI.SetThrottle((0.3*max_speed)/this_speed) ! def AddEngageAllOrderGroup(GI): unit_count=GI.GetUnitCount() *************** *** 549,551 **** --- 566,661 ---- AddEngageAllOrder(UnitInfo) + def GroupAllSensors(GI): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UnitInfo=GI.GetPlatformInterface(n) + UnitInfo.SetAllSensorState(1) + + def GroupPassiveSensors(GI): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UnitInfo=GI.GetPlatformInterface(n) + nSensors = UnitInfo.GetSensorCount() + for n in range(0, nSensors): + sensor_info = UnitInfo.GetSensorInfo(n) + if (sensor_info.IsPassive()): + UnitInfo.SetSensorState(n, 1) + else: + UnitInfo.SetSensorState(n, 0) + + def GroupOfflineSensors(GI): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UnitInfo=GI.GetPlatformInterface(n) + UnitInfo.SetAllSensorState(0) + + + def GroupHeloAltitudeMedium(GI): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UI=GI.GetPlatformInterface(n) + if(UI.IsHelo()): + AltitudeMedium(UI) + + def GroupHeloAltitudeLow(GI): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UI=GI.GetPlatformInterface(n) + if(UI.IsHelo()): + AltitudeLow(UI) + + def GroupHeloAltitudeVeryLow(GI): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UI=GI.GetPlatformInterface(n) + if(UI.IsHelo()): + AltitudeVeryLow(UI) + + def GroupAltitudeHigh(GI): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UI=GI.GetPlatformInterface(n) + if(UI.IsAir() and not UI.IsHelo()): + AltitudeHigh(UI) + + def GroupAltitudeMedium(GI): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UI=GI.GetPlatformInterface(n) + if(UI.IsAir() and not UI.IsHelo()): + AltitudeMedium(UI) + + def GroupAltitudeLow(GI): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UI=GI.GetPlatformInterface(n) + if(UI.IsAir() and not UI.IsHelo()): + AltitudeLow(UI) + + def GroupAltitudeVeryLow(GI): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UI=GI.GetPlatformInterface(n) + if(UI.IsAir() and not UI.IsHelo()): + AltitudeVeryLow(UI) + + def GroupAddLandingOrder(GI,dest_id): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UI=GI.GetPlatformInterface(n) + AddLandingOrder(UI,dest_id) + + def GroupAddLandingHBOrder(GI): + unit_count=GI.GetUnitCount() + for n in range(0,unit_count): + UI=GI.GetPlatformInterface(n) + BB = UI.GetBlackboardInterface() + homebase = BB.ReadMessage('Home') + if (homebase != ''): + if (UI.IsHelo()): + UI.AddTask('LandHelo', 3.0, 0) + else: + UI.AddTask('Land', 3.0, 0) + BB.Write('LandTarget', homebase) + |