/usr/share/games/colobot/ai/spider02.txt is in colobot-common 0.1.6-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | extern void object::Attack( )
{
int list[];
int i;
object p;
float dist, prox;
point dest;
errmode(0); // ne stoppe pas si erreur
while ( ismovie() != 0 ) wait(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++] = Derrick;
list[i++] = BotFactory;
list[i++] = PowerStation;
list[i++] = Converter;
list[i++] = RepairCenter;
list[i++] = DefenseTower;
list[i++] = AlienNest;
list[i++] = ResearchCenter;
list[i++] = RadarStation;
list[i++] = ExchangePost;
list[i++] = PowerPlant;
list[i++] = AutoLab;
list[i++] = NuclearPlant;
while ( true )
{
p = radar(list, 0, 360, 0, 30);
if ( p == null )
{
wait(2);
}
else
{
dist = distance(p.position, position);
if ( dist <= 10 )
{
fire();
}
else
{
prox = dist-5;
if ( prox > 25 ) prox = 25;
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);
}
}
}
}
|