function b_go_sibur($glob) { $case_to_go = find_shorter_way($glob['vision'], "sibur", $glob['lvl']); if ($case_to_go > 0) { $glob = build_way_to_go($glob, $case_to_go, "b_go_sibur"); return $glob; } else { if ($case_to_go == 0) { return $glob; } else { $glob = error_to_go($glob, 'b_sg_sibur'); return $glob; } } aff_error_code("Out of go stone"); }
function b_go_bouf($glob) { /* 1 cherche le plus cours chemi 2 Build path vers bouf */ $case_to_go = find_shorter_way($glob['vision'], "nourriture", $glob['lvl']); if ($case_to_go > 0) { // on vas chercher le chemin pour aller manger $glob = build_way_to_go($glob, $case_to_go, "b_go_bouf"); return $glob; } else { if ($case_to_go == 0) { //On est sur la bonne case aff_client("Il y a de la nourriture sur ma case !"); return $glob; } else { $glob = error_to_go($glob, 'b_bouff_20'); // il n y a pas de bouf sur la case return $glob; } } aff_error_code("Out of go bouf"); }