def canEverStopRevolt(unit, action):
if unit.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_RIOT_POLICE"):
return True
return False
def canStopRevoltOnPlot(unit, plot, action):
if plot.isCity() and plot.getPlotCity().getOccupationTimer() > 0:
return unit.atPlot(plot)
return False
def stopRevolt(unit, plot, action):
if plot.isCity():
plot.getPlotCity().setOccupationTimer(0)
unit.finishMoves()
CyInterface().addMessage(unit.getOwner(), False, 25, 'Your riot police have sucessfully ended the revolt in %s!' %(plot.getPlotCity().getName()), 'AS2D_FEAT_ACCOMPLISHED', 1, "", 10, plot.getX(), plot.getY(), True, True)
def canStopRevolt(unit, action):
return unit.canMove() and canStopRevoltOnPlot(unit, unit.plot(), action)
def shouldStopRevolt(unit, action):
pPlot = unit.plot()
return pPlot.isCity() and pPlot.getPlotCity().getOccupationTimer() > 0