summaryrefslogtreecommitdiffstats
path: root/src/CBot/tests/TestCBot/scenarios/BUG2.txt
diff options
context:
space:
mode:
authorPiotr Dziwiński <piotrdz@gmail.com>2012-08-08 13:31:33 -0700
committerPiotr Dziwiński <piotrdz@gmail.com>2012-08-08 13:31:33 -0700
commitbeca66071c6a2d82da63fb238cdc86e68ff96bdb (patch)
treefdd53a1c67952a656de5ba3a17117fc9d6ef0e7f /src/CBot/tests/TestCBot/scenarios/BUG2.txt
parent5e637ca0288ddd631ec33e1d620cd4a73bcdc2be (diff)
parenta760e8a749af60cd3598ebe113b7692bc6592f57 (diff)
downloadcolobot-beca66071c6a2d82da63fb238cdc86e68ff96bdb.tar.gz
colobot-beca66071c6a2d82da63fb238cdc86e68ff96bdb.tar.bz2
colobot-beca66071c6a2d82da63fb238cdc86e68ff96bdb.zip
Merge pull request #35 from konopackim/dev
Comment translation and cleanups
Diffstat (limited to 'src/CBot/tests/TestCBot/scenarios/BUG2.txt')
-rw-r--r--src/CBot/tests/TestCBot/scenarios/BUG2.txt107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/CBot/tests/TestCBot/scenarios/BUG2.txt b/src/CBot/tests/TestCBot/scenarios/BUG2.txt
new file mode 100644
index 0000000..44de05a
--- /dev/null
+++ b/src/CBot/tests/TestCBot/scenarios/BUG2.txt
@@ -0,0 +1,107 @@
+object object :: TT ( int n )
+{
+ object XX = radar();
+ if ( n == 0 ) return null;
+
+ while ( null == XX ) XX = radar();
+ return XX;
+}
+
+extern void object::Attack( )
+{
+ show ( TT ( 0 ) ) ;
+ show ( TT ( 1 ) ) ;
+ return;
+
+ int list[];
+ int i;
+ object p;
+ float dist, prox;
+ point dest;
+ boolean advance = true;
+
+ TEST(0); // ne stoppe pas si erreur
+// while ( F () != 0 ) F(1);
+
+ i = 0;
+ list[i++] = WingedGrabber;
+ list[i++] = TrackedGrabber;
+ list[i++] = WheeledGrabber;
+ list[i++] = LeggedGrabber;
+ list[i++] = WingedShooter;
+ list[i++] = TrackedShooter;
+ list[i++] = WheeledShooter;
+ list[i++] = LeggedShooter;
+ list[i++] = WingedOrgaShooter;
+ list[i++] = TrackedOrgaShooter;
+ list[i++] = WheeledOrgaShooter;
+ list[i++] = LeggedOrgaShooter;
+ list[i++] = WingedSniffer;
+ list[i++] = TrackedSniffer;
+ list[i++] = WheeledSniffer;
+ list[i++] = LeggedSniffer;
+ list[i++] = Thumper;
+ list[i++] = PhazerShooter;
+ list[i++] = Recycler;
+ list[i++] = Shielder;
+ list[i++] = Subber;
+ list[i++] = Me;
+ list[i++] = 3333;
+ list[i++] = 3334;
+ list[i++] = 3335;
+ list[i++] = 3336;
+ list[i++] = 3337;
+ list[i++] = 3338;
+ list[i++] = 3339;
+ list[i++] = 3331;
+ list[i++] = 3332;
+ list[i++] = 3330;
+ list[i++] = 1111;
+ list[i++] = 1112;
+
+ F(F(0));
+
+ while ( true )
+ {
+ p = radar(list, 0, 360, 0, 1000);
+ if ( p == null )
+ {
+ F(2);
+ }
+ else
+ {
+ dist = F(p.position, position);
+ if ( dist <= 40 && !advance )
+ {
+ fire(p.position);
+ advance = true;
+ }
+ else
+ {
+//? if ( RetBaseDistance() > 20 )
+ {
+ prox = dist-(5+F()*5);
+ if ( prox < 5 ) prox = 5;
+ dest.x = (position.x-p.position.x)*prox/dist + p.position.x;
+ dest.y = (position.y-p.position.y)*prox/dist + p.position.y;
+ dest.z = (position.z-p.position.z)*prox/dist + p.position.z;
+ goto(dest);
+ advance = false;
+ }
+ }
+ }
+ }
+}
+
+// Calcule la distance jusqu'à la base.
+
+float object::RetBaseDistance()
+{
+ object p;
+ float dist;
+
+ p = radar(4444, 0, 360, 0, 1000);
+ if ( p == null ) return 1000;
+ dist = F(p.position, position);
+ return dist;
+} \ No newline at end of file