Update CB levels with new layout, programs, visuals
parent
e68fd0af01
commit
13197a381a
levels/battles
chapter001/level001
chapter002
level001
level003
level004
|
@ -5,18 +5,19 @@ Resume.E text="Build your base and eliminate your foe!"
|
||||||
Level type=CODE_BATTLE magnifyDamage=10
|
Level type=CODE_BATTLE magnifyDamage=10
|
||||||
|
|
||||||
BeginObject
|
BeginObject
|
||||||
|
LevelController script="%cat%/deruiner.txt"
|
||||||
|
|
||||||
// Team "Blue" (1)
|
// Team "Blue" (1)
|
||||||
CreateObject pos= 5;-35 dir=1.5 type=WheeledGrabber team=1
|
CreateObject pos=-5;-65 dir=1.5 type=WheeledGrabber team=1 select=1
|
||||||
CreateObject pos=0;-35 type=Titanium
|
CreateObject pos=0;-65 type=Titanium
|
||||||
CreateObject pos=-5;-35 dir=1.5 type=WheeledBuilder team=1 select=true
|
CreateObject pos=5;-65 dir=1.5 type=WheeledBuilder team=1
|
||||||
CreateObject pos=0;-58 dir=1.5 type=Derrick magnifyDamage=0 selectable=false
|
CreateObject pos=0;-88 dir=1.5 type=Derrick team=1 magnifyDamage=0
|
||||||
|
|
||||||
// Team "Red" (2)
|
// Team "Red" (2)
|
||||||
CreateObject pos=-5;35 dir=0.5 type=WheeledGrabber team=2
|
CreateObject pos=5;65 dir=0.5 type=WheeledGrabber team=2
|
||||||
CreateObject pos=0;35 type=Titanium
|
CreateObject pos=0;65 type=Titanium
|
||||||
CreateObject pos=5;35 dir=0.5 type=WheeledBuilder team=2
|
CreateObject pos=-5;65 dir=0.5 type=WheeledBuilder team=2
|
||||||
CreateObject pos=0;58 dir=0.5 type=Derrick magnifyDamage=0 selectable=false
|
CreateObject pos=0;88 dir=0.5 type=Derrick team=2 magnifyDamage=0
|
||||||
|
|
||||||
EndMissionTake pos=0;0 dist=10000 type=Any team=-1 min=0 max=0 winTeam=1
|
EndMissionTake pos=0;0 dist=10000 type=Any team=-1 min=0 max=1 winTeam=1
|
||||||
EndMissionTake pos=0;0 dist=10000 type=Any team=-2 min=0 max=0 winTeam=2
|
EndMissionTake pos=0;0 dist=10000 type=Any team=-2 min=0 max=1 winTeam=2
|
||||||
|
|
|
@ -5,16 +5,16 @@ Resume.E text="A map for begginers! Research technologies, build your infrastruc
|
||||||
Level type=CODE_BATTLE
|
Level type=CODE_BATTLE
|
||||||
|
|
||||||
BeginObject
|
BeginObject
|
||||||
|
LevelController script="%cat%/deruiner.txt"
|
||||||
|
|
||||||
// Team "Blue" (1)
|
// Team "Blue" (1)
|
||||||
CreateObject pos=5;-35 dir=1.5 type=WheeledGrabber team=1
|
CreateObject pos=-5;-65 dir=1.5 type=WheeledGrabber team=1 select=1
|
||||||
CreateObject pos=0;-35 type=Titanium
|
CreateObject pos=0;-65 type=Titanium
|
||||||
CreateObject pos=-5;-35 dir=1.5 type=WheeledBuilder team=1 select=true
|
CreateObject pos=5;-65 dir=1.5 type=WheeledBuilder team=1
|
||||||
CreateObject pos=0;-58 dir=1.5 type=Derrick magnifyDamage=0 selectable=false
|
CreateObject pos=0;-88 dir=1.5 type=Derrick team=1 magnifyDamage=0
|
||||||
CreateObject pos=0;-65 dir=1.5 type=RadarStation magnifyDamage=0 selectable=false
|
CreateObject pos=-46;-103 dir=1.5 type=RadarStation team=1 magnifyDamage=0
|
||||||
|
|
||||||
// Team "Red" (2)
|
// Team "Red" (2)
|
||||||
// TODO: Write (or find) some better ant scripts for this purpose
|
|
||||||
CreateObject pos=0;35 type=AlienNest
|
CreateObject pos=0;35 type=AlienNest
|
||||||
CreateObject pos=-43;43 dir=0.3 type=AlienAnt script1="ant03.txt" run=1
|
CreateObject pos=-43;43 dir=0.3 type=AlienAnt script1="ant03.txt" run=1
|
||||||
CreateObject pos=33;31 dir=1.1 type=AlienAnt script1="antatt30.txt" run=1
|
CreateObject pos=33;31 dir=1.1 type=AlienAnt script1="antatt30.txt" run=1
|
||||||
|
@ -26,5 +26,5 @@ CreateObject pos=18;70 dir=0.7 type=AlienEgg autoValue1=14.4 autoType=AlienAnt a
|
||||||
CreateObject pos=-23;82 dir=0.1 type=AlienAnt script1="antattaw.txt" run=1
|
CreateObject pos=-23;82 dir=0.1 type=AlienAnt script1="antattaw.txt" run=1
|
||||||
CreateObject pos=-21;101 dir=0.5 type=AlienEgg autoValue1=38.5 autoType=AlienAnt autoString="ant03.txt" run=1
|
CreateObject pos=-21;101 dir=0.5 type=AlienEgg autoValue1=38.5 autoType=AlienAnt autoString="ant03.txt" run=1
|
||||||
|
|
||||||
|
EndMissionTake pos=0;0 dist=10000 type=Any team=1 lost=2
|
||||||
EndMissionTake pos=0;0 dist=10000 type=AlienAnt min=0 max=0
|
EndMissionTake pos=0;0 dist=10000 type=AlienAnt min=0 max=0
|
||||||
EndMissionTake pos=0;0 dist=10000 type=Any team=1 lost=0
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,4 @@
|
||||||
|
extern void object::BB_Builder()
|
||||||
|
{
|
||||||
|
BB_BuilderProgram();
|
||||||
|
}
|
|
@ -1,215 +0,0 @@
|
||||||
object RadarFriendly(int cat)
|
|
||||||
{
|
|
||||||
return radar(cat, 0, 360, 0, 1000, 1, FilterFriendly);
|
|
||||||
}
|
|
||||||
|
|
||||||
object SearchObjectAt(int cat, point pos)
|
|
||||||
{
|
|
||||||
object item = search(Titanium, pos);
|
|
||||||
if(item == null) return null;
|
|
||||||
if(distance(pos, item.position) > 0.5) return null;
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void object::StandardEnemy_Recharge()
|
|
||||||
{
|
|
||||||
object item = RadarFriendly(PowerStation);
|
|
||||||
goto(item.position);
|
|
||||||
if(this.load != null && this.load.category == PowerCell)
|
|
||||||
{
|
|
||||||
while(this.load.energyLevel < 1) wait(0.05);
|
|
||||||
}
|
|
||||||
while(this.energyLevel < 1) wait(0.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
void object::GetTitanium()
|
|
||||||
{
|
|
||||||
object item;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
item = radar(TitaniumOre, 0, 360, 0, 40);
|
|
||||||
}
|
|
||||||
while(item == null);
|
|
||||||
goto(item.position);
|
|
||||||
grab();
|
|
||||||
item = RadarFriendly(Converter);
|
|
||||||
goto(item.position);
|
|
||||||
drop();
|
|
||||||
move(-2.5);
|
|
||||||
point converterPos = item.position;
|
|
||||||
while((item = SearchObjectAt(Titanium, converterPos)) == null) wait(0.05);
|
|
||||||
goto(item.position);
|
|
||||||
grab();
|
|
||||||
}
|
|
||||||
|
|
||||||
void object::GetPowerCell()
|
|
||||||
{
|
|
||||||
object item = radar(PowerCell, 0, 360, 0, 40);
|
|
||||||
if (item != null)
|
|
||||||
{
|
|
||||||
goto(item.position);
|
|
||||||
grab();
|
|
||||||
if(item.energyLevel < 1)
|
|
||||||
{
|
|
||||||
StandardEnemy_Recharge();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GetTitanium();
|
|
||||||
item = RadarFriendly(PowerPlant);
|
|
||||||
goto(item.position);
|
|
||||||
drop();
|
|
||||||
while(item.energyCell == null || item.energyCell.category != PowerCell) wait(0.05);
|
|
||||||
grab();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void object::BuildSomewhere(int cat)
|
|
||||||
{
|
|
||||||
GetTitanium();
|
|
||||||
goto(flatspace(this.position, 10, 10, 40, 8));
|
|
||||||
drop();
|
|
||||||
build(cat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void object::GoResearch(int what)
|
|
||||||
{
|
|
||||||
GetPowerCell();
|
|
||||||
object item = RadarFriendly(ResearchCenter);
|
|
||||||
goto(item.position);
|
|
||||||
while(item.busy()) wait(0.05);
|
|
||||||
if (item.energyCell != null)
|
|
||||||
{
|
|
||||||
drop(Behind);
|
|
||||||
grab();
|
|
||||||
turn(90);
|
|
||||||
drop();
|
|
||||||
turn(-90);
|
|
||||||
grab(Behind);
|
|
||||||
}
|
|
||||||
drop();
|
|
||||||
item.research(what);
|
|
||||||
}
|
|
||||||
|
|
||||||
void object::FactoryRobot(int cat, string program)
|
|
||||||
{
|
|
||||||
GetTitanium();
|
|
||||||
object item = RadarFriendly(BotFactory);
|
|
||||||
goto(item.position);
|
|
||||||
drop();
|
|
||||||
move(-5);
|
|
||||||
item.factory(cat, program);
|
|
||||||
point pos = this.position;
|
|
||||||
GetPowerCell();
|
|
||||||
goto(pos);
|
|
||||||
turn(direction(item.position));
|
|
||||||
while(radar(cat, 0, 45, 0, 10) == null) wait(0.05);
|
|
||||||
goto(item.position);
|
|
||||||
drop();
|
|
||||||
move(-5);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern void object::StandardEnemy()
|
|
||||||
{
|
|
||||||
// TODO: Enable after done debugging
|
|
||||||
//errmode(0);
|
|
||||||
|
|
||||||
build(Converter);
|
|
||||||
BuildSomewhere(PowerStation);
|
|
||||||
BuildSomewhere(BotFactory);
|
|
||||||
BuildSomewhere(PowerPlant);
|
|
||||||
BuildSomewhere(ResearchCenter);
|
|
||||||
GoResearch(ResearchWinged);
|
|
||||||
GoResearch(ResearchShooter);
|
|
||||||
while(true)
|
|
||||||
{
|
|
||||||
if (this.energyCell.energyLevel < 0.25)
|
|
||||||
{
|
|
||||||
StandardEnemy_Recharge();
|
|
||||||
}
|
|
||||||
FactoryRobot(WingedShooter, "StandardEnemy_Attack");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void object::StandardEnemy_Attack()
|
|
||||||
{
|
|
||||||
while(this.energyCell == null) wait(0.05);
|
|
||||||
while(radar(Any, 180, 45, 0, 5) != null) wait(0.05);
|
|
||||||
move(-7.5);
|
|
||||||
|
|
||||||
while(true)
|
|
||||||
{
|
|
||||||
if(this.energyCell.energyLevel < 0.3 || this.temperature > 0.5)
|
|
||||||
{
|
|
||||||
StandardEnemy_Recharge();
|
|
||||||
while(this.temperature > 0) wait(0.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isInFront = true;
|
|
||||||
object item = radar(Any, 0, 120, 0, 1000, 1, FilterEnemy);
|
|
||||||
if (item == null)
|
|
||||||
{
|
|
||||||
isInFront = false;
|
|
||||||
item = radar(Any, 0, 360, 0, 1000, 1, FilterEnemy);
|
|
||||||
if (item == null)
|
|
||||||
{
|
|
||||||
wait(0.05);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float targetHeight = topo(this.position);
|
|
||||||
if(targetHeight < 0) targetHeight = 0;
|
|
||||||
targetHeight += 9;
|
|
||||||
|
|
||||||
float targetSpeed = distance(this.position, item.position)/40;
|
|
||||||
if(targetSpeed > 1) targetSpeed = 1;
|
|
||||||
if(!isInFront) targetSpeed = 1;
|
|
||||||
|
|
||||||
float targetDirection = direction(item.position);
|
|
||||||
|
|
||||||
bool canShoot = true;
|
|
||||||
if(abs(targetDirection) > 10) canShoot = false;
|
|
||||||
if(distance(this.position, item.position) > 40) canShoot = false;
|
|
||||||
|
|
||||||
/*
|
|
||||||
Here we calculate the aim angle
|
|
||||||
Take a look at this picture:
|
|
||||||
(yes, I'm terrible at ASCII-art :P)
|
|
||||||
|
|
||||||
\/ target
|
|
||||||
***
|
|
||||||
* ***
|
|
||||||
H* ***
|
|
||||||
* angle** \/ robot
|
|
||||||
*************
|
|
||||||
L
|
|
||||||
*/
|
|
||||||
float H = item.position.z-this.position.z;
|
|
||||||
float L = distance2d(this.position, item.position);
|
|
||||||
float angle = atan(H/L);
|
|
||||||
if(aim(angle, -targetDirection) != 0) canShoot = false; // funkcja aim() zwraca != 0 jesli cel poza zasiegiem
|
|
||||||
|
|
||||||
if(!canShoot) targetSpeed = 1;
|
|
||||||
|
|
||||||
jet((targetHeight-this.position.z)/4);
|
|
||||||
if(targetDirection < 0)
|
|
||||||
{
|
|
||||||
motor(targetSpeed, targetSpeed+targetDirection/90);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
motor(targetSpeed-targetDirection/90, targetSpeed);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(canShoot)
|
|
||||||
{
|
|
||||||
fire(0.1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wait(0.05);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,19 +5,19 @@ Resume.E text="Challenge the developers! Fight against a simple enemy program."
|
||||||
Level type=CODE_BATTLE magnifyDamage=10
|
Level type=CODE_BATTLE magnifyDamage=10
|
||||||
|
|
||||||
BeginObject
|
BeginObject
|
||||||
|
LevelController script="%cat%/deruiner.txt"
|
||||||
|
|
||||||
// Team "Blue" (1)
|
// Team "Blue" (1)
|
||||||
CreateObject pos=5;-35 dir=1.5 type=WheeledGrabber team=1
|
CreateObject pos=-5;-65 dir=1.5 type=WheeledGrabber team=1 select=1
|
||||||
CreateObject pos=0;-35 type=Titanium
|
CreateObject pos=0;-65 type=Titanium
|
||||||
CreateObject pos=-5;-35 dir=1.5 type=WheeledBuilder team=1 select=true
|
CreateObject pos=5;-65 dir=1.5 type=WheeledBuilder team=1
|
||||||
CreateObject pos=0;-58 dir=1.5 type=Derrick magnifyDamage=0 selectable=false
|
CreateObject pos=0;-88 dir=1.5 type=Derrick team=1 magnifyDamage=0 selectable=0
|
||||||
|
|
||||||
// Team "Red" (2)
|
// Team "Red" (2)
|
||||||
// TODO: selectable=0, but only before start?
|
CreateObject pos=5;65 dir=0.5 type=WheeledGrabber trainer=1 team=2 script1="%lvl%/program-a.txt" run=1 selectable=0
|
||||||
CreateObject pos=-5;35 dir=0.5 type=WheeledGrabber team=2 script1="%lvl%/program-a.txt" scriptReadOnly1=true run=1
|
CreateObject pos=0;65 type=Titanium
|
||||||
CreateObject pos=0;35 type=Titanium
|
CreateObject pos=-5;65 dir=0.5 type=WheeledBuilder trainer=1 team=2 script1="%lvl%/program-b.txt" run=1 selectable=0
|
||||||
CreateObject pos=5;35 dir=0.5 type=WheeledBuilder team=2 script1="%lvl%/program-b.txt" scriptReadOnly1=true run=1
|
CreateObject pos=0;88 dir=0.5 type=Derrick team=2 magnifyDamage=0 selectable=0
|
||||||
CreateObject pos=0;58 dir=0.5 type=Derrick magnifyDamage=0 selectable=false
|
|
||||||
|
|
||||||
EndMissionTake pos=0;0 dist=10000 type=Any team=1 lost=0
|
EndMissionTake pos=0;0 dist=10000 type=Any team=1 lost=1
|
||||||
EndMissionTake pos=0;0 dist=10000 type=Any team=-1 min=0 max=0
|
EndMissionTake pos=0;0 dist=10000 type=Any team=2 min=0 max=1
|
||||||
|
|
|
@ -10,8 +10,7 @@ BeginObject
|
||||||
CreateObject pos=0;-40 dir=1.5 type=WingedShooter range=0 power=100 team=1 select=true
|
CreateObject pos=0;-40 dir=1.5 type=WingedShooter range=0 power=100 team=1 select=true
|
||||||
|
|
||||||
// Team "Red" (2)
|
// Team "Red" (2)
|
||||||
// TODO: selectable=0, but only before start?
|
CreateObject pos=0;40 dir=0.5 type=PracticeBot team=2 script1="flash.txt" run=1 selectable=0
|
||||||
CreateObject pos=0;40 dir=0.5 type=PracticeBot team=2 script1="flash.txt" scriptReadOnly1=true run=1
|
|
||||||
|
|
||||||
DoneResearch type=WINGER
|
DoneResearch type=WINGER
|
||||||
DoneResearch type=SHOOTER
|
DoneResearch type=SHOOTER
|
||||||
|
|
|
@ -10,8 +10,7 @@ BeginObject
|
||||||
CreateObject pos=0;-40 dir=1.5 type=WingedShooter range=0 power=100 team=1 select=true
|
CreateObject pos=0;-40 dir=1.5 type=WingedShooter range=0 power=100 team=1 select=true
|
||||||
|
|
||||||
// Team "Red" (2)
|
// Team "Red" (2)
|
||||||
// TODO: selectable=0, but only before start?
|
CreateObject pos=0;40 dir=0.5 type=WingedShooter trainer=1 range=0 power=100 team=2 script1="%lvl%/program.txt" run=1 selectable=0
|
||||||
CreateObject pos=0;40 dir=0.5 type=WingedShooter range=0 power=100 team=2 script1="%lvl%/program.txt" scriptReadOnly1=true run=1
|
|
||||||
|
|
||||||
DoneResearch type=WINGER
|
DoneResearch type=WINGER
|
||||||
DoneResearch type=SHOOTER
|
DoneResearch type=SHOOTER
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
extern void object::Deruin()
|
||||||
|
{
|
||||||
|
while(true)
|
||||||
|
{
|
||||||
|
while(radar(606) != null)
|
||||||
|
{
|
||||||
|
delete(radar(606).id);
|
||||||
|
wait(rand()+1);
|
||||||
|
}
|
||||||
|
wait(1);
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ FogColor air=0.816;0.784;0.875;0.000 water=0.369;0.600;0.706;0.000 // magenta
|
||||||
VehicleColor color=0.784;0.769;0.682;0.000 // sable
|
VehicleColor color=0.784;0.769;0.682;0.000 // sable
|
||||||
VehicleColor team=1 color=0;0;1
|
VehicleColor team=1 color=0;0;1
|
||||||
VehicleColor team=2 color=1;0;0
|
VehicleColor team=2 color=1;0;0
|
||||||
|
SecondTexture rank=1
|
||||||
Background up=0.937;0.875;0.878;0.000 down=0.749;0.753;0.875;0.000 cloudUp=0.306;0.306;0.498;0.000 cloudDown=0.306;0.306;0.498;
|
Background up=0.937;0.875;0.878;0.000 down=0.749;0.753;0.875;0.000 cloudUp=0.306;0.306;0.498;0.000 cloudDown=0.306;0.306;0.498;
|
||||||
ForegroundName image="lens5.png"
|
ForegroundName image="lens5.png"
|
||||||
Planet pos=3.0;0.2 dim=0.35 speed= 0.001 dir=0.4 image="planet03.png" uv1=0.5;0.5 uv2=1.0;1.0
|
Planet pos=3.0;0.2 dim=0.35 speed= 0.001 dir=0.4 image="planet03.png" uv1=0.5;0.5 uv2=1.0;1.0
|
||||||
|
@ -106,5 +107,14 @@ EnableResearch type=iGUN
|
||||||
EnableResearch type=SUBBER
|
EnableResearch type=SUBBER
|
||||||
EnableResearch type=SNIFFER
|
EnableResearch type=SNIFFER
|
||||||
EnableResearch type=RECYCLER
|
EnableResearch type=RECYCLER
|
||||||
|
EnableResearch type=BUILDER
|
||||||
|
DoneResearch type=BUILDER
|
||||||
|
|
||||||
|
View eye= 20;25;-100 lookat=-8;8;-10 button=136
|
||||||
|
View eye=-20;25; 100 lookat= 8;8;10 button=159
|
||||||
|
View eye=0;175;0 lookat=0;0;0.1 button=95
|
||||||
|
View eye=85;35;0 lookat=0;25;0 button=79
|
||||||
|
|
||||||
|
EndMissionDelay win=5 lost=5
|
||||||
|
|
||||||
Camera eye=0.00;5.00;0.00 lookat=0.00;1.00;0.00 delay=0
|
Camera eye=0.00;5.00;0.00 lookat=0.00;1.00;0.00 delay=0
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 451 B |
Loading…
Reference in New Issue