Commit a588097f22aafd391eadb76a16f8da2554bf8437
1 parent
61ee43ab
plop
git-svn-id: http://svn.net-core.org/repos/t-engine4@2905 51575b47-30f0-44d4-a5cc-537603b46e54
Showing
2 changed files
with
7 additions
and
5 deletions
... | ... | @@ -82,7 +82,7 @@ function _M:display(dispx, dispy) |
82 | 82 | if self.target_type.block_path then |
83 | 83 | block, hit, hit_radius = self.target_type:block_path(lx, ly) |
84 | 84 | end |
85 | - | |
85 | + | |
86 | 86 | -- Update coordinates and set color |
87 | 87 | if hit and not stopped then |
88 | 88 | stop_x, stop_y = lx, ly |
... | ... | @@ -106,7 +106,7 @@ function _M:display(dispx, dispy) |
106 | 106 | s = self.sr |
107 | 107 | stopped = true |
108 | 108 | end |
109 | - | |
109 | + | |
110 | 110 | lx, ly = l() |
111 | 111 | end |
112 | 112 | 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) |
202 | 202 | end |
203 | 203 | } |
204 | 204 | |
205 | - table.update(t, target_type) | |
206 | 205 | -- And now modify for the default types |
207 | 206 | if t.type then |
208 | 207 | if t.type:find("ball") then |
... | ... | @@ -211,6 +210,7 @@ function _M:getType(t) |
211 | 210 | if t.type:find("cone") then |
212 | 211 | target_type.cone = t.radius |
213 | 212 | target_type.cone_angle = t.cone_angle or 55 |
213 | + target_type.selffire = false | |
214 | 214 | end |
215 | 215 | if t.type:find("bolt") then |
216 | 216 | 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 |
35 | 35 | max_power = 1000, power_regen = 1, |
36 | 36 | 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, |
37 | 37 | use = function(self, who) |
38 | + local pricemod = function(o) if o.type == "gem" then return 0.40 else return 0.15 end end | |
39 | + | |
38 | 40 | -- On the floor or inventory |
39 | 41 | if game.level.map:getObjectTotal(who.x, who.y) > 0 then |
40 | 42 | 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) |
41 | - local price = o:getPrice() * o:getNumber() | |
43 | + local price = o:getPrice() * o:getNumber() * pricemod(o) | |
42 | 44 | price = math.min(price, 25) |
43 | 45 | game.level.map:removeObject(who.x, who.y, idx) |
44 | 46 | who:incMoney(price) |
... | ... | @@ -48,7 +50,7 @@ When activated it will prompt to destroy items on the floor, if there are none i |
48 | 50 | game:registerDialog(d) |
49 | 51 | else |
50 | 52 | 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) |
51 | - local price = o:getPrice() * o:getNumber() | |
53 | + local price = o:getPrice() * o:getNumber() * pricemod(o) | |
52 | 54 | price = math.min(price, 25) |
53 | 55 | who:removeObject(who:getInven("INVEN"), idx, true) |
54 | 56 | who:sortInven() | ... | ... |
-
Please register or login to post a comment