13 Robot_Specs to_return =
new Robot_Specs();
15 to_return.power = to_return.charge = skill_points/3;
16 to_return.defense = skill_points/3 + skill_points%3;
21 to_return.defense = 0;
23 to_return.power = skill_points - to_return.charge;
33 int remaining_power = status.power;
34 int remaining_charge = status.charge;
39 int repair_amount = (my_specs.charge*10 - status.health) * 2;
40 if(repair_amount > status.
power)
41 repair_amount = status.power - status.power%2;
44 api.repair(repair_amount);
46 catch(
RoboSim.RoboSimExecutionException e)
48 System.out.println(e.getMessage());
50 remaining_power-=repair_amount;
51 remaining_charge-=repair_amount;
62 int to_save = my_specs.charge*9 - remaining_charge;
63 if(to_save > remaining_power)
64 to_save = remaining_power;
65 remaining_power-=to_save;
69 if(remaining_power > 0)
72 api.defend((remaining_power <= my_specs.defense) ? remaining_power :
my_specs.
defense);
74 catch(
RoboSim.RoboSimExecutionException e)
76 System.out.println(e.getMessage());
Robot_Specs createRobot(WorldAPI api, int skill_points, byte[] message)
void act(WorldAPI api, Robot_Status status, byte[][] received_radio)