18.10.2008, 13:57 | #1 |
Местный
|
ява
кто умеет програмирывать на яве? я так и не понял как приделать ситуации чтобы боты их говарили Jarny как я понял разбирается тут. Сегодня 3 чеса ковырялся с кодом не чего не получилось я даже не знаю что править чтоб вкл часть кода.
|
18.10.2008, 15:08 | #2 |
Местный
|
вот все что есть про 5 минут до цели
1 маневр класс. case 21: // '\025' AP.setWayPoint(true); if(mn_time > 300F) pop(); if(isTick(256, 0) && !actor.isTaskComplete() && (AP.way.isLast() && AP.getWayPointDistance() < 1500F || AP.way.isLanding())) World.onTaskComplete(actor); if(((Aircraft)actor).aircNumber() == 0 && !isReadyToReturn()) { World.cur(); if(((Aircraft)actor).getRegiment() == World.getPlayerAircraft().getRegiment()) { float f9 = 1E+012F; if(AP.way.curr().Action == 3) { f9 = AP.getWayPointDistance(); } else { int i = AP.way.Cur(); AP.way.next(); if(AP.way.curr().Action == 3) f9 = AP.getWayPointDistance(); AP.way.setCur(i); } if(Speak5minutes == 0 && 22000F < f9 && f9 < 30000F) { Voice.speak5minutes((Aircraft)actor); Speak5minutes = 1; } if(Speak1minute == 0 && f9 < 10000F) { Voice.speak1minute((Aircraft)actor); Speak1minute = 1; Speak5minutes = 1; } if((WeWereInGAttack || WeWereInAttack) && mn_time > 5F) { if(!SpeakMissionAccomplished) { boolean flag = false; int j = AP.way.Cur(); if(AP.way.curr().Action == 3 || AP.way.curr().getTarget() != null) break; while(AP.way.Cur() < AP.way.size() - 1) { AP.way.next(); if(AP.way.curr().Action == 3 || AP.way.curr().getTarget() != null) flag = true; } AP.way.setCur(j); if(!flag) { Voice.speakMissionAccomplished((Aircraft)actor); SpeakMissionAccomplished = true; } } if(!SpeakMissionAccomplished) { Speak5minutes = 0; Speak1minute = 0; SpeakBeginGattack = 0; } WeWereInGAttack = false; WeWereInAttack = false; } } } if(((actor instanceof TypeBomber) || (actor instanceof TypeTransport)) && AP.way.curr() != null && AP.way.curr().Action == 3 && (AP.way.curr().getTarget() == null || (actor instanceof Scheme4))) { double d = Loc.z - World.land().HQ(Loc.x, Loc.y); if(d < 0.0D) d = 0.0D; if((double)AP.getWayPointDistance() < (double)getSpeed() * Math.sqrt(d * 0.20386999845504761D) && !bombsOut) { if(CT.Weapons[3] != null && CT.Weapons[3][0] != null && CT.Weapons[3][0].countBullets() != 0 && !(CT.Weapons[3][0] instanceof BombGunPara)) Voice.airSpeaks((Aircraft)actor, 85, 1); bombsOut = true; AP.way.curr().Action = 0; if(Group != null) Group.dropBombs(); } } setSpeedMode(3); if(AP.way.isLandingOnShip() && AP.way.isLanding()) { AP.way.landingAirport.rebuildLandWay(this); if(CT.bHasCockpitDoorControl) AS.setCockpitDoor(actor, 1); } break; |
18.10.2008, 15:12 | #3 |
Местный
|
2 пилот.класс
public void setManeuverByTask() { clear_stack(); switch (get_task()) { case 2: if (Leader != null && Actor.isValid(Leader.actor) && !Leader.isReadyToReturn() && !Leader.isReadyToDie() && Leader.getSpeed() > 35.0F) set_maneuver(24); else set_task(3); break; case 3: set_maneuver(21); if (!AP.way.isLanding()) { wingman(true); if (Leader == null) { boolean bool = false; int i; float f; if (AP.way.Cur() < AP.way.size() - 1) { AP.way.next(); i = AP.way.curr().Action; bool = AP.way.curr().getTarget() != null; f = AP.getWayPointDistance(); AP.way.prev(); } else { i = AP.way.curr().Action; f = AP.getWayPointDistance(); } Pilot pilot_6_ = (Pilot) ((Aircraft) actor).FM; float f_7_ = AP.getWayPointDistance(); while (pilot_6_.Wingman != null) { pilot_6_ = (Pilot) pilot_6_.Wingman; pilot_6_.wingman(true); pilot_6_.AP.way.setCur(AP.way.Cur()); if (!pilot_6_.AP.way.isLanding() && pilot_6_.get_task() == 3) pilot_6_.set_task(2); } if (((Aircraft) actor).aircIndex() == 0 && Speak5minutes == 0 && i == 3 && (double) f < 30000.0) { Voice.speak5minutes((Aircraft) actor); Speak5minutes = 1; } } } break; case 4: if (get_maneuver() == 0) set_maneuver(21); if (danger == null) set_task(3); else { if (actor instanceof TypeFighter) { bombsOut = true; CT.dropFuelTanks(); } dist = (float) Loc.distance(danger.Loc); VDanger.sub(danger.Loc, Loc); OnMe.scale(-1.0, VDanger); Maneuver.tmpOr.setYPR(Or.getYaw(), 0.0F, 0.0F); Maneuver.tmpOr.transformInv(VDanger); diffV.sub(danger.Vwld, Vwld); Maneuver.tmpOr.transformInv(diffV); diffVLength = diffV.length(); Maneuver.tmpOr.setYPR(danger.Or.getYaw(), 0.0F, 0.0F); danger.Or.transformInv(OnMe); VDanger.normalize(); OnMe.normalize(); dE = (Energy - danger.Energy) * 0.1019F; Energed = danger.Energy > Energy; Faster = danger.getSpeed() > getSpeed(); Higher = danger.Loc.z > Loc.z; Near = dist < 300.0F; OnBack = VDanger.x < 0.0 && dist < 2000.0F; Visible = VDanger.dot(MainLook) > 0.0; Looks = OnMe.x > 0.0; VDanger.normalize(); if (OnBack && Near && danger instanceof TypeFighter && (actor instanceof TypeTransport || Wingman == null || killed(Wingman) || ((Pilot) Wingman).target != danger)) { if (isLeader()) { if ((actor instanceof TypeFighter || (actor instanceof TypeStormovik && Skill > 1 && AP.way.curr().Action == 0)) && Wingman != null && !killed(Wingman) && !((Pilot) Wingman).requestCoverFor(this)) { if (Wingman.Wingman != null && !killed(Wingman.Wingman)) ((Pilot) Wingman.Wingman) .requestCoverFor(this); else if (Skill >= 2) { Aircraft aircraft = War.getNearestFriendlyFighter(((Aircraft) actor), 8000.0F); if (aircraft != null && aircraft.FM instanceof Pilot) ((Pilot) aircraft.FM) .requestCoverFor(this); } } } else if (Skill >= 2) { Aircraft aircraft = War.getNearestFriendlyFighter((Aircraft) actor, 8000.0F); if (aircraft instanceof TypeFighter && aircraft.FM instanceof Pilot) ((Pilot) aircraft.FM).requestCoverFor(this); } } if (actor instanceof TypeFighter) fighterDefence(); else if (actor instanceof TypeStormovik) stormovikDefence(); else transportDefence(); } break; case 5: if (airClient != null && !killed(airClient)) { followOffset.set(100.0, 0.0, 20.0); set_maneuver(65); } else { airClient = null; if (target != null && !killed(target)) { set_task(6); set_maneuver(0); } else { set_task(3); set_maneuver(21); } } break; case 6: WeWereInAttack = true; if (actor instanceof TypeFighter) { bombsOut = true; CT.dropFuelTanks(); } if (target == null || !hasCourseWeaponBullets()) { if (AP.way.curr().Action == 3) { set_task(7); set_maneuver(0); } else { set_task(3); if (Leader != null) set_maneuver(24); else set_maneuver(21); } } else { int i = ((Aircraft) actor).aircIndex(); if (target.actor instanceof TypeBomber) attackBombers(); else if (target.actor instanceof TypeStormovik) attackStormoviks(); else { if (i == 0 || i == 2) set_maneuver(27); if (i == 1 || i == 3) { if (Leader != null && !killed(Leader)) { airClient = Leader; set_task(5); set_maneuver(0); } else set_maneuver(27); } } } break; case 7: if (!WeWereInGAttack) WeWereInGAttack = true; if (!Actor.isAlive(target_ground)) { set_task(2); set_maneuver(0); } else { boolean bool = true; if (CT.Weapons[0] != null && CT.Weapons[0][0] != null && CT.Weapons[0][0].bulletMassa() > 0.05F && CT.Weapons[0][0].countBullets() > 0) bool = false; if (bool && CT.getWeaponMass() < 15.0F || CT.getWeaponMass() < 1.0F) { Voice.speakEndOfAmmo((Aircraft) actor); set_task(2); set_maneuver(0); if (AP.way.curr().Action != 3) AP.way.next(); target_ground = null; } if (target_ground instanceof Prey && (((Prey) target_ground).HitbyMask() & 0x1) == 0) { float f = 0.0F; for (int i = 0; i < 4; i++) { if (CT.Weapons[i] != null && CT.Weapons[i][0] != null && CT.Weapons[i][0].countBullets() != 0 && CT.Weapons[i][0].bulletMassa() > f) f = CT.Weapons[i][0].bulletMassa(); } if (f < 0.08F || target_ground instanceof TgtShip && f < 0.55F) { set_task(2); set_maneuver(0); if (AP.way.curr().Action != 3) AP.way.next(); target_ground = null; } } if (CT.Weapons[3] != null && CT.Weapons[3][0] != null && CT.Weapons[3][0].countBullets() != 0) { if (CT.Weapons[3][0] instanceof TorpedoGun) { if (target_ground instanceof TgtShip) set_maneuver(51); else set_maneuver(43); } else if (CT.Weapons[3][0] instanceof BombGunPara) { AP.way.curr().setTarget(null); target_ground = null; set_maneuver(21); } else if (CT.Weapons[3][0].bulletMassa() < 10.0F) set_maneuver(52); else if (actor instanceof TypeDiveBomber && Alt > 1200.0F) set_maneuver(50); else set_maneuver(43); } else { if (target_ground instanceof BridgeSegment) { set_task(2); set_maneuver(0); if (AP.way.curr().Action != 3) AP.way.next(); target_ground = null; } if (actor instanceof TypeFighter || actor instanceof TypeStormovik) set_maneuver(43); else { set_task(2); set_maneuver(0); if (AP.way.curr().Action != 3) AP.way.next(); target_ground = null; } } } break; case 0: if (isReadyToDie()) set_maneuver(49); break; case 1: set_maneuver(45); break; } } |
18.10.2008, 15:15 | #4 |
Местный
|
у кого какие предложения как вкл нормально?
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1) | |
|
|