never seen that
This commit is contained in:
parent
c68897c5d1
commit
a2405abab4
|
|
@ -148,41 +148,37 @@ public class Spiel {
|
|||
}
|
||||
if (weiter) {
|
||||
double tordis = s.p.getDistance(nichtballteam.torwart.p);
|
||||
if(tordis <10){
|
||||
tor();
|
||||
}else{
|
||||
tordis = s.p.getDistance(nichtballteam.torwart.p);
|
||||
Spieler t = null;
|
||||
boolean ss = false;
|
||||
for (Spieler m : ballteam.spieler) {
|
||||
Spieler t = null;
|
||||
boolean ss = false;
|
||||
for (Spieler m : ballteam.spieler) {
|
||||
|
||||
if (!m.equals(s)) {
|
||||
if (m.p.getDistance(nichtballteam.torwart.p) < tordis) {
|
||||
t = m;
|
||||
ss = true;
|
||||
}
|
||||
if (!m.equals(s)) {
|
||||
if (m.p.getDistance(nichtballteam.torwart.p) < tordis) {
|
||||
t = m;
|
||||
ss = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (t != null&&ss) {
|
||||
Flugbahn fb = new Flugbahn(s.p, t.p);
|
||||
boolean succes = false;
|
||||
for (Spieler temp : nichtballteam.spieler) {
|
||||
if (fb.isInRange(temp.p)) {
|
||||
// Pass wurde unterbrochen
|
||||
temp.takeBall(s);
|
||||
succes = true;
|
||||
ballWechsel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!succes) {
|
||||
System.out.println(s.getname() + " passt Ball an " + t.getname());
|
||||
// Ball wurde weg gepasst
|
||||
t.takeBall(s);
|
||||
if (t != null&&ss) {
|
||||
Flugbahn fb = new Flugbahn(s.p, t.p);
|
||||
boolean succes = false;
|
||||
for (Spieler temp : nichtballteam.spieler) {
|
||||
if (fb.isInRange(temp.p)) {
|
||||
// Pass wurde unterbrochen
|
||||
temp.takeBall(s);
|
||||
succes = true;
|
||||
ballWechsel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!succes) {
|
||||
System.out.println(s.getname() + " passt Ball an " + t.getname());
|
||||
// Ball wurde weg gepasst
|
||||
t.takeBall(s);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -191,11 +187,11 @@ public class Spiel {
|
|||
|
||||
public void torPhase(){
|
||||
if(ballBesitz){
|
||||
if(b.s.p.getDistance(auswärtsteam.torwart.p)<20){
|
||||
if(b.s.p.getDistance(auswärtsteam.torwart.p)<5){
|
||||
tor();
|
||||
}
|
||||
}else{
|
||||
if(b.s.p.getDistance(heimteam.torwart.p)<20){
|
||||
if(b.s.p.getDistance(heimteam.torwart.p)<5){
|
||||
tor();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue