No more pro lackers who pass the limit.

This commit is contained in:
Loudrob 2015-05-21 19:45:40 -04:00
parent 5411a83e72
commit 820732c776
4 changed files with 13 additions and 3 deletions

View file

@ -91,6 +91,9 @@ class DistributedNPCLaffRestock(DistributedNPCToonBase):
elif mode == LaffRestockGlobals.NoMoney: elif mode == LaffRestockGlobals.NoMoney:
self.setChatAbsolute(TTLocalizer.RestockNoMoneyMessage, CFSpeech | CFTimeout) self.setChatAbsolute(TTLocalizer.RestockNoMoneyMessage, CFSpeech | CFTimeout)
self.resetLaffClerk() self.resetLaffClerk()
elif mode == NPCToons.SELL_MOVIE_CHEATER:
self.setChatAbsolute(TTLocalizer.RestockCheaterMessage, CFSpeech | CFTimeout)
self.resetLaffClerk()
def __handleRestock(self, laff, cost): def __handleRestock(self, laff, cost):
self.sendUpdate('restock', [self.av.doId, laff, cost]) self.sendUpdate('restock', [self.av.doId, laff, cost])

View file

@ -89,6 +89,11 @@ class DistributedNPCLaffRestockAI(DistributedNPCToonBaseAI):
return return
av = simbase.air.doId2do.get(avId) av = simbase.air.doId2do.get(avId)
if av: if av:
if av.getMaxHp() < (av.getHp() + laff):
movieType = NPCToons.SELL_MOVIE_CHEATER
self.air.writeServerEvent('suspicious', avId, 'DistributedNPCLaffRestockAI.restock invalid restock')
self.notify.warning('somebody tried to buy an invalid hp restock! avId: %s' % avId)
else:
movieType = NPCToons.SELL_MOVIE_COMPLETE movieType = NPCToons.SELL_MOVIE_COMPLETE
av.takeMoney(cost) av.takeMoney(cost)
av.b_setHp(av.getHp() + laff) av.b_setHp(av.getHp() + laff)

View file

@ -44,6 +44,7 @@ SELL_MOVIE_TIMEOUT = 8
SELL_MOVIE_PETRETURNED = 9 SELL_MOVIE_PETRETURNED = 9
SELL_MOVIE_PETADOPTED = 10 SELL_MOVIE_PETADOPTED = 10
SELL_MOVIE_PETCANCELED = 11 SELL_MOVIE_PETCANCELED = 11
SELL_MOVIE_CHEATER = 15
PARTY_MOVIE_CLEAR = 0 PARTY_MOVIE_CLEAR = 0
PARTY_MOVIE_START = 1 PARTY_MOVIE_START = 1
PARTY_MOVIE_COMPLETE = 2 PARTY_MOVIE_COMPLETE = 2

View file

@ -8438,3 +8438,4 @@ RestockFullLaffMessage = "You're already happy!"
RestockNoMoneyMessage = "You need more jellybeans to restock your laff!" RestockNoMoneyMessage = "You need more jellybeans to restock your laff!"
RestockLaffMessage = "Have fun!" RestockLaffMessage = "Have fun!"
RestockAskMessage = "Would you like to\nrestock %s laff for %s jellybeans?" RestockAskMessage = "Would you like to\nrestock %s laff for %s jellybeans?"
RestockCheaterMessage = "No cheaters allowed! Your transaction has been declined."