Added decrease_maxpower and increase_maxpower

This commit is contained in:
shamoanjac 2016-08-15 10:16:12 +02:00
parent ba012f1c0a
commit 047ae6ae7c

View File

@ -133,6 +133,18 @@ function factions.Faction.decrease_power(self, power)
factions.save()
end
function factions.Faction.increase_maxpower(self, power)
self.maxpower = self.maxpower + power
factions.save()
end
function factions.Faction.decrease_maxpower(self, power)
self.maxpower = self.maxpower - power
if self.maxpower < 0. then -- should not happen
self.maxpower = 0.
end
end
function factions.Faction.add_player(self, player, rank)
self:on_player_join(player)
self.players[player] = rank or self.default_rank