23 to_return.
power = to_return.
charge = skill_points/3;
24 to_return.
defense = skill_points/3 + skill_points%3;
41 int remaining_power = status.
power;
42 int remaining_charge = status.
charge;
47 int repair_amount = (my_specs.
charge*10 - status.
health) * 2;
48 if(repair_amount > status.
power)
56 cerr << e.
msg << endl;
58 remaining_power-=repair_amount;
59 remaining_charge-=repair_amount;
67 if(remaining_charge < my_specs.
charge*9)
70 int to_save = my_specs.
charge*9 - remaining_charge;
71 if(to_save > remaining_power)
72 to_save = remaining_power;
73 remaining_power-=to_save;
77 if(remaining_power > 0)
84 cerr << e.
msg << endl;
void act(WorldAPI &api, Robot_Status status, vector< vector< uint8_t >> received_radio)
virtual void defend(int power)=0
Robot_Specs createRobot(WorldAPI *api, int skill_points, vector< uint8_t > message)
virtual void repair(int power)=0