forked from mtcontrib/factions
Added decrease_maxpower and increase_maxpower
This commit is contained in:
parent
ba012f1c0a
commit
047ae6ae7c
12
factions.lua
12
factions.lua
@ -133,6 +133,18 @@ function factions.Faction.decrease_power(self, power)
|
|||||||
factions.save()
|
factions.save()
|
||||||
end
|
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)
|
function factions.Faction.add_player(self, player, rank)
|
||||||
self:on_player_join(player)
|
self:on_player_join(player)
|
||||||
self.players[player] = rank or self.default_rank
|
self.players[player] = rank or self.default_rank
|
||||||
|
Loading…
Reference in New Issue
Block a user