2
0
Эх сурвалжийг харах

Fix Backstab; Start Industria tiles;

bjorn 11 жил өмнө
parent
commit
81b83e7e34

+ 32 - 1
data/maps/industria/tiles.lua

@@ -1,10 +1,41 @@
 local tiles = {}
 local tiles = {}
+local function t(x) table.insert(tiles, x) end
 
 
 -- background
 -- background
 for x = 0, map.width, map.textures.background[3] do
 for x = 0, map.width, map.textures.background[3] do
   for y = 0, map.height, map.textures.background[4] do
   for y = 0, map.height, map.textures.background[4] do
-    table.insert(tiles, {'background', x, y})
+    t({'background', x, y})
   end
   end
 end
 end
 
 
+-- metal
+t({'metal', 544, 416})
+t({'metal', 608, 416})
+t({'metal', 672, 416})
+t({'metal', 736, 416})
+t({'metal', 800, 416})
+
+t({'metal', 544, 480})
+t({'metal', 608, 480})
+t({'metal', 672, 480})
+t({'metal', 736, 480})
+
+t({'metal', 544, 544})
+t({'metal', 608, 544})
+t({'metal', 672, 544})
+
+t({'metal', 544, 608})
+t({'metal', 608, 608})
+t({'metal', 672, 608})
+
+--
+
+t({'metal', 992, 480})
+t({'metal', 1056, 480})
+t({'metal', 1056, 544})
+t({'metal', 1120, 416})
+t({'metal', 1120, 480})
+t({'metal', 1120, 544})
+t({'metal', 1120, 608})
+
 return tiles
 return tiles

+ 1 - 1
data/spell/dagger.lua

@@ -18,7 +18,7 @@ function Dagger:activate(owner)
   if self.target then
   if self.target then
     backstab = math.abs(math.anglediff(self.target.angle, math.direction(self.target.x, self.target.y, self.owner.x, self.owner.y))) > math.pi / 2
     backstab = math.abs(math.anglediff(self.target.angle, math.direction(self.target.x, self.target.y, self.owner.x, self.owner.y))) > math.pi / 2
     local damage = data.weapon.dagger.damage
     local damage = data.weapon.dagger.damage
-    if backstab then damage = target.health end
+    if backstab then damage = self.target.health end
     ctx.net:emit(evtDamage, {id = self.target.id, amount = damage, from = self.owner.id, tick = tick})
     ctx.net:emit(evtDamage, {id = self.target.id, amount = damage, from = self.owner.id, tick = tick})
   end
   end
   
   

+ 1 - 1
lib/player.lua

@@ -151,7 +151,7 @@ function Player:slot(input)
   
   
   if input.l and weapon:canFire(self) then
   if input.l and weapon:canFire(self) then
     weapon:fire(self, input.x, input.y)
     weapon:fire(self, input.x, input.y)
-    ctx.net:emit(evtFire, {id = self.id, slot = self.weapon})
+    ctx.net:emit(evtFire, {id = self.id, slot = self.weapon, mx = input.x, my = input.y})
   end
   end
   
   
   if input.r and skill:canFire(self) then
   if input.r and skill:canFire(self) then