Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 10 additions & 21 deletions scripts/actors/TomOfMastery.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,29 @@ local RPD = require "scripts/lib/commonClasses"

local actor = require "scripts/lib/actor"

local dungeonEntrance = {13, 4}
local shopEntrance = {18, 16}
local dungeonEntrance = { 13, 4 }
local shopEntrance = { 18, 16 }

local lastWarningTime = 0
local time = 0

return actor.init({


act = function()

local levelW = RPD.Dungeon.level:getWidth()
local levelH = RPD.Dungeon.level:getHeight()

for i = 0, levelW do
for j = 0, levelH do
local cell = RPD.Dungeon.level:cell(i,j)
local enemy = RPD.Actor:findChar(cell)
end
end

local hero = RPD.Dungeon.hero

if hero:getBelongings():getItem("TomeOfMastery") ~= nil then
hero:getBelongings():getItem("TomeOfMastery"):detach(hero:getBelongings().backpack)
end
hero:getBelongings():getItem("TomeOfMastery"):detach(hero:getBelongings().backpack)
end

return true
end,


actionTime = function()
return 1
end,


activate = function()
end
})
46 changes: 24 additions & 22 deletions scripts/actors/town/Compass.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@ local Spells = require "scripts/spells/CustomSpellsList"

local actor = require "scripts/lib/actor"

local dungeonEntrance = {13, 4}
local shopEntrance = {18, 16}
local dungeonEntrance = { 13, 4 }
local shopEntrance = { 18, 16 }

local lastWarningTime = 0
local time = 0

return actor.init({
act = function()
local hero = RPD.Dungeon.hero
local hero = RPD.Dungeon.hero

time = time + 1

if hero:getItemFromSlot("WEAPON"):valid() or hero:getItemFromSlot("LEFT_HAND"):valid() then
if hero:getItemFromSlot("WEAPON"):valid() or hero:getItemFromSlot("LEFT_HAND"):valid() then
RPD.Dungeon.level:setCompassTarget(table.unpack(dungeonEntrance))
else
RPD.Dungeon.level:setCompassTarget(table.unpack(shopEntrance))

if time - lastWarningTime > 10 then
local heroPos = RPD.getXy(hero)

local d2 = (dungeonEntrance[1] - heroPos[1])^2 + (dungeonEntrance[2] - heroPos[2])^2
local d2 = (dungeonEntrance[1] - heroPos[1]) ^ 2 + (dungeonEntrance[2] - heroPos[2]) ^ 2
if d2 < 9 then
hero:interrupt()
lastWarningTime = time
local wnd = RPD.new(RPD.Objects.Ui.WndQuest,hero,RPD.textById("TownScript_NeedWeapon"))
local wnd = RPD.new(RPD.Objects.Ui.WndQuest, hero, RPD.textById("TownScript_NeedWeapon"))
RPD.GameScene:show(wnd)
end
end
Expand All @@ -48,21 +48,23 @@ return actor.init({
return 1
end,
activate = function()
local hero = RPD.Dungeon.hero
local Stats = storage.gameGet("") or {}

if Stats.str == nil then
sMas = {"Stats","MagicBolt","ShadowClone","Chop"}
Que.pushMas("spelllist",sMas)
Spells["Combat"] = Que.getMas("spelllist")

local ModWnd = RPD.new(RPD.Objects.Ui.WndStory,RPD.textById("ModWnd"))
RPD.GameScene:show(ModWnd)

if hero:getBelongings():getItem("TomeOfMastery") ~= nil then
hero:getBelongings():getItem("TomeOfMastery"):detach(hero:getBelongings().backpack)
end

end
local hero = RPD.Dungeon.hero
local Stats = storage.gameGet("") or {}

if Stats.str == nil then
sMas = { "Stats", "MagicBolt", "ShadowClone", "Chop" }
Que.pushMas("spelllist", sMas)
Spells["Combat"] = Que.getMas("spelllist")

local ModWnd = RPD.new(RPD.Objects.Ui.WndStory, RPD.textById("ModWnd"))
RPD.GameScene:show(ModWnd)

if hero:getBelongings():getItem("TomeOfMastery") ~= nil then
hero:getBelongings():getItem("TomeOfMastery"):detach(hero:getBelongings().backpack)
end
end



end
})
2 changes: 1 addition & 1 deletion scripts/buffs/ChopBuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ return buff.init{
Spell.lvl = Spell.lvl+1
end

if RPG.noBloodMobs[enemy:name()] ~= "false" then
if not RPG.noBloodMobs[enemy:name()] then
local buffs = RPD.affectBuff(enemy,"FastBleeding",2)
buffs:level( RPG.smartInt( RPG.physStr()*0.1) )
RPD.topEffect(enemy:getPos(),"bleeding_effect")
Expand Down
362 changes: 183 additions & 179 deletions scripts/buffs/PowerBuff.lua

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/buffs/RPGbuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ return buff.init{
hero = RPD.Dungeon.hero
level = RPD.Dungeon.level
depth = RPD.Dungeon.depth
subClass = storage.gameGet("subClassNone")
subClass = storage.gameGet("subClassNone", {none = "", actv = 1})
local Spells = require "scripts/spells/CustomSpellsList"
local weapon = hero:getBelongings().weapon
local lefthand = hero:getBelongings().leftHand
Expand Down
2 changes: 1 addition & 1 deletion scripts/items/StudentStaff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ return item.init{

typicalSTR = function(self,item,user)
str = math.max(stra-2*item:level(),1)
if self.data.level < item:level() then
if (self.data.level or 0) < item:level() then
self.data.level = item:level()
self.data.dstats[4] = self.data.dstats[4] +magAsLevel
if self.data.equipped == 1 then
Expand Down
Loading