/** * @see ISimulationObserver::onShootFailure() */ public function onShootFailure(SimulationMatch $match, SimulationPlayer $scorer, SimulationPlayer $goaly) { // downgrade striker, if he isno hero yet (= scored at least two goals) if ($scorer->getGoals() < 3) { $scorer->downgradeMark(MARK_DOWNGRADE_SHOOTFAILURE); } $goaly->improveMark(MARK_IMPROVE_SHOOTFAILURE_GOALY); // consider goals against goaly, in order to prevent goalies in team of the day, even though team lost very high. if ($goaly->team->getGoals() > 3) { $goaly->setMark(max(2.0, $goaly->getMark())); } $scorer->setShoots($scorer->getShoots() + 1); }