Skip to content
Snippets Groups Projects
Commit a588097f authored by dg's avatar dg
Browse files

plop

git-svn-id: http://svn.net-core.org/repos/t-engine4@2905 51575b47-30f0-44d4-a5cc-537603b46e54
parent 61ee43ab
No related branches found
No related tags found
No related merge requests found
......@@ -82,7 +82,7 @@ function _M:display(dispx, dispy)
if self.target_type.block_path then
block, hit, hit_radius = self.target_type:block_path(lx, ly)
end
-- Update coordinates and set color
if hit and not stopped then
stop_x, stop_y = lx, ly
......@@ -106,7 +106,7 @@ function _M:display(dispx, dispy)
s = self.sr
stopped = true
end
lx, ly = l()
end
self.cursor:toScreen(self.display_x + (self.target.x - game.level.map.mx) * self.tile_w * Map.zoom, self.display_y + (self.target.y - game.level.map.my) * self.tile_h * Map.zoom, self.tile_w * Map.zoom, self.tile_h * Map.zoom)
......@@ -202,7 +202,6 @@ function _M:getType(t)
end
}
table.update(t, target_type)
-- And now modify for the default types
if t.type then
if t.type:find("ball") then
......@@ -211,6 +210,7 @@ function _M:getType(t)
if t.type:find("cone") then
target_type.cone = t.radius
target_type.cone_angle = t.cone_angle or 55
target_type.selffire = false
end
if t.type:find("bolt") then
target_type.stop_block = true
......
......@@ -35,10 +35,12 @@ When activated it will prompt to destroy items on the floor, if there are none i
max_power = 1000, power_regen = 1,
use_power = { name = "open a portal to send items to the Fortress core, extracting energies from it for the Fortress and sending back useless gold.", power = 0,
use = function(self, who)
local pricemod = function(o) if o.type == "gem" then return 0.40 else return 0.15 end end
-- On the floor or inventory
if game.level.map:getObjectTotal(who.x, who.y) > 0 then
local d = require("engine.dialogs.ShowPickupFloor").new("Transmogrify", who.x, who.y, function(o) if o:getPrice() <= 0 or o.quest then return false end return true end, function(o, idx)
local price = o:getPrice() * o:getNumber()
local price = o:getPrice() * o:getNumber() * pricemod(o)
price = math.min(price, 25)
game.level.map:removeObject(who.x, who.y, idx)
who:incMoney(price)
......@@ -48,7 +50,7 @@ When activated it will prompt to destroy items on the floor, if there are none i
game:registerDialog(d)
else
local d = require("engine.dialogs.ShowInventory").new("Transmogrify", who:getInven("INVEN"), function(o) if o:getPrice() <= 0 or o.quest then return false end return true end, function(o, idx)
local price = o:getPrice() * o:getNumber()
local price = o:getPrice() * o:getNumber() * pricemod(o)
price = math.min(price, 25)
who:removeObject(who:getInven("INVEN"), idx, true)
who:sortInven()
......
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