diff --git a/src/games/rcll/globals.clp b/src/games/rcll/globals.clp index de68a8f96..547c3752d 100644 --- a/src/games/rcll/globals.clp +++ b/src/games/rcll/globals.clp @@ -86,7 +86,8 @@ ?*TECHCHALL-WAM-TIME* = 300 ?*TECHCHALL-NAVIGATION-TIME* = 60 ; number of allowed robot maintenance cycles - ?*MAINTENANCE-ALLOWED-CYCLES* = 1 + ?*MAINTENANCE-ALLOWED-CYCLES* = 2 + ?*MAINTENANCE-COST* = (create$ 0 5) ?*MAINTENANCE-ALLOWED-TIME* = 120 ?*MAINTENANCE-WARN-TIME* = 105 ?*MAINTENANCE-GRACE-TIME* = 15 diff --git a/src/games/rcll/orders.clp b/src/games/rcll/orders.clp index b8dc88d2b..cb91666e7 100644 --- a/src/games/rcll/orders.clp +++ b/src/games/rcll/orders.clp @@ -256,6 +256,6 @@ (defrule order-print-points (points (game-time ?gt) (points ?points) (team ?team) (phase ?phase) (reason ?reason)) => - (printout t "Awarding " ?points " points to team " ?team ": " ?reason + (printout t "Giving " ?points " points to team " ?team ": " ?reason " (" ?phase " @ " ?gt ")" crlf) ) diff --git a/src/games/rcll/robots.clp b/src/games/rcll/robots.clp index 9c9765719..f55c5f21f 100644 --- a/src/games/rcll/robots.clp +++ b/src/games/rcll/robots.clp @@ -85,7 +85,7 @@ (defrule robot-recv-SetRobotMaintenance ?pf <- (protobuf-msg (type "llsf_msgs.SetRobotMaintenance") (ptr ?p) (rcvd-via STREAM)) - (gamestate (cont-time ?ctime)) + (gamestate (phase ?phase) (cont-time ?ctime) (game-time ?game-time)) => (retract ?pf) ; message will be destroyed after rule completes (do-for-fact ((?robot robot)) @@ -99,6 +99,14 @@ (printout t "Robot " ?robot:number " scheduled for maintenance cycle " ?cycle crlf) (modify ?robot (state MAINTENANCE) (maintenance-start-time ?ctime) (maintenance-cycles ?cycle) (maintenance-warning-sent FALSE)) + (bind ?cycle-cost (nth$ ?cycle ?*MAINTENANCE-COST*)) + (if (neq ?cycle-cost nil) + then + (assert (points (game-time ?game-time) + (points (* -1 ?cycle-cost)) + (team ?robot:team-color) (phase ?phase) + (reason (str-cat "Maintenance of robot " ?robot:number)))) + ) ) else (bind ?maint-time (- ?ctime ?robot:maintenance-start-time)) diff --git a/src/shell/robot.cpp b/src/shell/robot.cpp index 8ad5fd8b5..5be0434cc 100644 --- a/src/shell/robot.cpp +++ b/src/shell/robot.cpp @@ -149,13 +149,13 @@ LLSFRefBoxShellRobot::refresh() printw(1, width() - 5, "%s", RobotState_Name(state_).substr(0,3).c_str()); standend(); + attron(A_BOLD); if (maintenance_cycles_ > 0) { - attron(A_BOLD); attron(' '|COLOR_PAIR(COLOR_RED_ON_BACK)); - //mvwaddwstr(w, 1, width() - 1, L"\u26a0"); - printw(1, width() - 1, "!"); - standend(); } + //mvwaddwstr(w, 1, width() - 1, L"\u26a0"); + printw(1, width() - 1, "%1i", maintenance_cycles_); + standend(); } else { bkgd(' '|COLOR_PAIR(COLOR_DEFAULT));