Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Commit

Permalink
[skyblock] Use max_level instead of constant static 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Lymkwi committed Jul 8, 2016
1 parent 1c32e67 commit 77fdff8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions mods/mff_skyblock/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ minetest.register_on_joinplayer(function(player)
u[priv] = true
end

if skyblock.feats.get_level(playername) < 5 and not u.kick and (u.fly or u.fast) then
if skyblock.feats.get_level(playername) < skyblock.max_level and not u.kick and (u.fly or u.fast) then
u.fly = nil
u.fast = nil
minetest.chat_send_player(playername, "You have lost FLY and FAST. You will earn these privileges when you reach level 5.")
minetest.chat_send_player(playername, "Complete the quests in your inventory to level up. Each level has a new set of quests.")
end
if skyblock.feats.get_level(playername) == 5 then
if skyblock.feats.get_level(playername) == skyblock.max_level then
u.fly = true
u.fast = true
minetest.chat_send_player(playername, "You have the fly & fast privilege and it's normal.")
Expand Down
14 changes: 8 additions & 6 deletions mods/skyblock_levels/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ License: GPLv3

local modpath = minetest.get_modpath('skyblock_levels')

skyblock.max_level = 5

dofile(modpath..'/skyblock.craft_guide.lua')

dofile(modpath..'/skyblock.feats.lua')
dofile(modpath..'/skyblock.levels.lua')
dofile(modpath..'/skyblock.levels.1.lua')
dofile(modpath..'/skyblock.levels.2.lua')
dofile(modpath..'/skyblock.levels.3.lua')
dofile(modpath..'/skyblock.levels.4.lua')
dofile(modpath..'/skyblock.levels.5.lua')

for lvl = 1, skyblock.max_level do
dofile(modpath..'/skyblock.levels.' .. lvl .. '.lua')
skyblock.log("Level " .. lvl .. " loaded")
end

dofile(modpath..'/register_abm.lua')
dofile(modpath..'/register_craft.lua')
Expand All @@ -27,4 +29,4 @@ dofile(modpath..'/register_node.lua')
dofile(modpath..'/register_misc.lua')

-- log that we started
skyblock.log('[MOD]'..minetest.get_current_modname()..' -- loaded from '..minetest.get_modpath(minetest.get_current_modname()))
skyblock.log('[MOD] '..minetest.get_current_modname()..' -- loaded from '..minetest.get_modpath(minetest.get_current_modname()))

0 comments on commit 77fdff8

Please sign in to comment.