Skip to content
Snippets Groups Projects
Commit 25d821f7 authored by DarkGod's avatar DarkGod
Browse files

Added an option to disallow online event pushes (but why would anyone do that is beyond me!)

Online events can now happen in the Infinite Dungeon too!
parent 1d4bf520
No related branches found
No related tags found
No related merge requests found
......@@ -2058,4 +2058,21 @@ end
function _M:alternateZoneTier1(short_name, ...)
if not game.state:tier1Killed(1) and not config.settings.cheat then return "DEFAULT" end
return self:alternateZone(short_name, ...)
end
\ No newline at end of file
end
function _M:grabOnlineEventZone()
if not config.settings.tome.allow_online_events then return end
if not self.birth.grab_online_event_zone or not self.birth.grab_online_event_spot then return nil end
return self.birth.grab_online_event_zone()
end
function _M:grabOnlineEventSpot(zone, level)
if not config.settings.tome.allow_online_events then return end
if not self.birth.grab_online_event_zone or not self.birth.grab_online_event_spot then return nil end
return self.birth.grab_online_event_spot(zone, level)
end
function _M:allowOnlineEvent()
if not config.settings.tome.allow_online_events then return end
return true
end
......@@ -23,7 +23,7 @@ local Map = require "engine.Map"
module(..., package.seeall, class.inherit(Zone))
_M:enableLastPersistZones(3)
--_M:enableLastPersistZones(3)
--- Called when the zone file is loaded
function _M:onLoadZoneFile(basedir)
......
......@@ -78,6 +78,14 @@ newBirthDescriptor{
campaign_name = "maj-eyal",
__allow_rod_recall = true,
__allow_transmo_chest = true,
grab_online_event_zone = function() return "wilderness-1" end,
grab_online_event_spot = function(zone, level)
local find = {type="world-encounter", subtype="maj-eyal"}
local where = game.level:pickSpotRemove(find)
while where and (game.level.map:checkAllEntities(where.x, where.y, "block_move") or not game.level.map:checkAllEntities(where.x, where.y, "can_encounter")) do where = game.level:pickSpotRemove(find) end
local x, y = mod.class.Encounter:findSpot(where)
return x, y
end,
},
}
......@@ -142,6 +150,11 @@ newBirthDescriptor{
__allow_transmo_chest = true,
is_infinite_dungeon = true,
ignore_prodigies_special_reqs = true,
grab_online_event_zone = function() return "infinite-dungeon-"..(game.level.level+rng.range(1,4)) end,
grab_online_event_spot = function(zone, level)
local x, y = game.state:findEventGrid(level)
return x, y
end,
},
}
......
......@@ -28,6 +28,10 @@ local imbue_ring = function(npc, player)
player:removeObject(player:getInven("INVEN"), gem_item)
ring.wielder = ring.wielder or {}
table.mergeAdd(ring.wielder, gem.imbue_powers, true)
if gem.talent_on_spell then
ring.talent_on_spell = ring.talent_on_spell or {}
table.append(ring.talent_on_spell, gem.talent_on_spell)
end
ring.name = gem.name .. " ring"
ring.been_imbued = true
ring.egoed = true
......@@ -62,6 +66,18 @@ local artifact_imbue_amulet = function(npc, player)
table.mergeAdd(amulet.wielder, gem1.imbue_powers, true)
table.mergeAdd(amulet.wielder, gem2.imbue_powers, true)
table.mergeAdd(amulet.wielder, gem3.imbue_powers, true)
if gem1.talent_on_spell then
amulet.talent_on_spell = amulet.talent_on_spell or {}
table.append(amulet.talent_on_spell, gem1.talent_on_spell)
end
if gem2.talent_on_spell then
amulet.talent_on_spell = amulet.talent_on_spell or {}
table.append(amulet.talent_on_spell, gem2.talent_on_spell)
end
if gem3.talent_on_spell then
amulet.talent_on_spell = amulet.talent_on_spell or {}
table.append(amulet.talent_on_spell, gem3.talent_on_spell)
end
amulet.name = "Limmir's Amulet of the Moon"
amulet.been_imbued = true
amulet.unique = util.uuid()
......
......@@ -100,7 +100,9 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr)
-- Increases damage
local mind_linked = false
if src.inc_damage then
local inc = src:combatGetDamageIncrease(type)
local inc
if src.combatGetDamageIncrease then inc = src:combatGetDamageIncrease(type)
else inc = (src.inc_damage.all or 0) + (src.inc_damage[type] or 0) end
-- Increases damage for the entity type (Demon, Undead, etc)
if target.type and src.inc_damage_actor_type then
......
......@@ -366,6 +366,15 @@ function _M:generateListOnline()
return "select to configure"
end, fct=function(item) game:registerDialog(require("engine.dialogs.ChatChannels").new()) end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Allow various events that are pushed by the server when playing online\nDisabling this will make you miss cool and fun zones.#WHITE#"}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Allow online events#WHITE##{normal}#", status=function(item)
return tostring(config.settings.tome.allow_online_events and "enabled" or "disabled")
end, fct=function(item)
config.settings.tome.allow_online_events = not config.settings.tome.allow_online_events
game:saveSettings("tome.allow_online_events", ("tome.allow_online_events = %s\n"):format(tostring(config.settings.tome.allow_online_events)))
self.c_list:drawItem(item)
end,}
self.list = list
end
......
......@@ -81,6 +81,7 @@ if type(config.settings.tome.lore_popup) == "nil" then config.settings.tome.lore
if type(config.settings.tome.auto_hotkey_object) == "nil" then config.settings.tome.auto_hotkey_object = true end
if type(config.settings.tome.immediate_melee_keys) == "nil" then config.settings.tome.immediate_melee_keys = true end
if type(config.settings.tome.immediate_melee_keys_auto) == "nil" then config.settings.tome.immediate_melee_keys_auto = true end
if type(config.settings.tome.allow_online_events) == "nil" then config.settings.tome.allow_online_events = true end
if not config.settings.tome.fonts then config.settings.tome.fonts = {type="fantasy", size="normal"} end
if not config.settings.tome.ui_theme2 then config.settings.tome.ui_theme2 = "metal" end
if not config.settings.tome.uiset_mode then config.settings.tome.uiset_mode = "Minimalist" end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment