Bjorn 11 lat temu
rodzic
commit
46ae038408

+ 0 - 22
data/buff/shadowform.lua

@@ -1,22 +0,0 @@
-local Shadowform = {}
-
-Shadowform.name = 'Shadowform'
-Shadowform.code = 'shadowform'
-Shadowform.text = 'Eva is more dangerous but more vulnerable.'
-
-function Shadowform:activate()
-  self.depth = 4
-  if ctx.view then ctx.view:register(self) end
-end
-
-function Shadowform:deactivate()
-  if ctx.view then ctx.view:unregister(self) end
-end
-
-function Shadowform:draw()
-  love.graphics.setColor(0, 0, 0, 100)
-  local x, y = self.owner:drawPosition()
-  love.graphics.circle('fill', x, y, 26)
-end
-
-return Shadowform

+ 0 - 24
data/buff/smokescreen.lua

@@ -1,24 +0,0 @@
-local Smokescreen = {}
-
-----------------
--- Meta
-----------------
-Smokescreen.name = 'Smokescreen'
-Smokescreen.code = 'smokescreen'
-Smokescreen.text = 'This unit is slowed.'
-Smokescreen.hide = false
-
-
-----------------
--- Data
-----------------
-function Smokescreen:activate()
-  self.amount = self.owner.maxSpeed * .4
-  self.owner.maxSpeed = self.owner.maxSpeed - self.amount
-end
-
-function Smokescreen:deactivate()
-  self.owner.maxSpeed = self.owner.maxSpeed + self.amount
-end
-
-return Smokescreen

+ 31 - 0
data/buff/subterfuge.lua

@@ -0,0 +1,31 @@
+local Subterfuge = {}
+
+----------------
+-- Meta
+----------------
+Subterfuge.name = 'Subterfuge'
+Subterfuge.code = 'subterfuge'
+Subterfuge.text = 'Eva is cloaked because she killed someone.'
+Subterfuge.hide = false
+
+----------------
+-- Data
+----------------
+Subterfuge.duration = 1.5
+
+function Subterfuge:activate()
+	self.timer = Subterfuge.duration
+end
+
+function Subterfuge:update()
+	self.owner.cloak = 1
+	self.timer = timer.rot(self.timer, function()
+		ctx.buffs:remove(self.owner, self.code)
+	end)
+end
+
+function Subterfuge:stack()
+	self.timer = self.duration
+end
+
+return Subterfuge

+ 4 - 4
data/class/eva.lua

@@ -6,7 +6,7 @@ Eva.code = 'eva'
 -- Stats
 -- Stats
 ----------------
 ----------------
 Eva.health = 180
 Eva.health = 180
-Eva.speed  = 195
+Eva.speed  = 225
 
 
 
 
 ----------------
 ----------------
@@ -25,10 +25,10 @@ Eva.quote = '???'
 ----------------
 ----------------
 Eva.slots = {}
 Eva.slots = {}
 
 
-Eva.slots[1] = data.weapon.knife
-Eva.slots[2] = data.skill.shadowdash
+Eva.slots[1] = data.weapon.dagger
+Eva.slots[2] = data.skill.dusk
 Eva.slots[3] = data.skill.smokescreen
 Eva.slots[3] = data.skill.smokescreen
-Eva.slots[4] = data.skill.shadowform
+Eva.slots[4] = data.skill.subterfuge
 Eva.slots[5] = data.skill.backstab
 Eva.slots[5] = data.skill.backstab
 
 
 return Eva
 return Eva

+ 0 - 0
data/media/graphics/icons/knife.png → data/media/graphics/icons/dagger.png


+ 0 - 0
data/media/graphics/icons/shadowdash.png → data/media/graphics/icons/dusk.png


+ 0 - 0
data/media/graphics/icons/shadowform.png → data/media/graphics/icons/subterfuge.png


+ 36 - 0
data/skill/dusk.lua

@@ -0,0 +1,36 @@
+local Dusk = {}
+
+Dusk.name = 'Dusk'
+Dusk.code = 'dusk'
+Dusk.text = 'Move through the shadows.'
+Dusk.type = 'skill'
+
+Dusk.cooldown = 8
+
+function Dusk:activate(owner)
+  self.timer = 0
+  self.stacks = 2
+end
+
+function Dusk:update(owner)
+  self.timer = timer.rot(self.timer, function()
+  	if self.stacks == 0 then self.stacks = 2 end
+  end)
+end
+
+function Dusk:canFire(owner)
+  return self.timer == 0 and self.stacks > 0
+end
+
+function Dusk:fire(owner, mx, my)
+  ctx.spells:activate(owner.id, data.spell.dusk, mx, my)
+  self.stacks = self.stacks - 1
+  self.timer = self.stacks == 0 and self.cooldown or .15
+end
+
+function Dusk:value(owner)
+	if self.stacks > 0 then return self.timer / .15 end
+  return self.timer / self.cooldown
+end
+
+return Dusk

+ 0 - 51
data/skill/shadowdash.lua

@@ -1,51 +0,0 @@
-local ShadowDash = {}
-
-ShadowDash.name = 'Shadow Dash'
-ShadowDash.code = 'shadowdash'
-ShadowDash.text = 'Shadow Dash'
-ShadowDash.type = 'skill'
-
-ShadowDash.cooldown = 5
-
-function ShadowDash:activate(shadowDash)
-  shadowDash.timer = 0
-  shadowDash.reuse = 0
-end
-
-function ShadowDash:update(shadowDash)
-  shadowDash.timer = timer.rot(shadowDash.timer)
-  shadowDash.reuse = timer.rot(shadowDash.reuse, function()
-    shadowDash.timer = shadowDash.cooldown
-  end)
-end
-
-function ShadowDash:canFire(shadowDash)
-  return shadowDash.timer == 0
-end
-
-function ShadowDash:fire(shadowDash)
-  ctx.spells:activate(self.id, data.spell.shadowdash)
-  if shadowDash.reuse == 0 then
-    shadowDash.timer = .5
-    shadowDash.reuse = 2.5
-  else
-    shadowDash.timer = shadowDash.cooldown
-    shadowDash.reuse = 0
-  end
-end
-
-function ShadowDash:value(shadowDash)
-  if shadowDash.timer ~= 0 then
-    if shadowDash.reuse ~= 0 then return shadowDash.timer / .5 end
-    return shadowDash.timer / shadowDash.cooldown
-  else
-    return shadowDash.reuse / 2
-  end
-end
-
-function ShadowDash:draw(shadowDash)
-  love.graphics.setColor(255, 255, 255, 100)
-  love.graphics.draw(self.class.sprite, self.x + math.dx(data.spell.shadowdash.distance, self.angle), self.y + math.dy(data.spell.shadowdash.distance, self.angle), self.angle, 1, 1, self.class.anchorx, self.class.anchory)
-end
-
-return ShadowDash

+ 0 - 33
data/skill/shadowform.lua

@@ -1,33 +0,0 @@
-local Shadowform = {}
-
-Shadowform.name = 'Shadowform'
-Shadowform.code = 'shadowform'
-Shadowform.text = 'Become one with the shadows.'
-Shadowform.type = 'skill'
-
-Shadowform.cooldown = 9
-
-function Shadowform:activate(shadowform)
-  shadowform.timer = 0
-end
-
-function Shadowform:update(shadowform)
-  shadowform.timer = timer.rot(shadowform.timer, function()
-    ctx.buffs:remove(self, 'shadowform')
-  end)
-end
-
-function Shadowform:canFire(shadowform)
-  return shadowform.timer == 0
-end
-
-function Shadowform:fire(shadowform)
-  ctx.buffs:add(self, 'shadowform')
-  shadowform.timer = shadowform.cooldown
-end
-
-function Shadowform:value(shadowform)
-  return shadowform.timer / shadowform.cooldown
-end
-
-return Shadowform

+ 13 - 12
data/skill/smokescreen.lua

@@ -2,30 +2,31 @@ local Smokescreen = {}
 
 
 Smokescreen.name = 'Smokescreen'
 Smokescreen.name = 'Smokescreen'
 Smokescreen.code = 'smokescreen'
 Smokescreen.code = 'smokescreen'
-Smokescreen.text = 'Slow and blind enemies.'
+Smokescreen.text = 'Hide under a cover of smoke.'
 Smokescreen.type = 'skill'
 Smokescreen.type = 'skill'
 
 
+Smokescreen.needsMouse = true
 Smokescreen.cooldown = 14
 Smokescreen.cooldown = 14
 
 
-function Smokescreen:activate(smokescreen)
-  smokescreen.timer = 0
+function Smokescreen:activate(owner)
+  self.timer = 0
 end
 end
 
 
-function Smokescreen:update(smokescreen)
-  smokescreen.timer = timer.rot(smokescreen.timer)
+function Smokescreen:update(owner)
+  self.timer = timer.rot(self.timer)
 end
 end
 
 
-function Smokescreen:canFire(smokescreen)
-  return smokescreen.timer == 0
+function Smokescreen:canFire(owner)
+  return self.timer == 0
 end
 end
 
 
-function Smokescreen:fire(smokescreen)
-  ctx.spells:activate(self.id, data.spell.smokescreen)
-  smokescreen.timer = smokescreen.cooldown
+function Smokescreen:fire(owner, mx, my)
+  ctx.spells:activate(owner.id, data.spell.smokescreen, mx, my)
+  self.timer = self.cooldown
 end
 end
 
 
-function Smokescreen:value(smokescreen)
-  return smokescreen.timer / smokescreen.cooldown
+function Smokescreen:value(owner)
+  return self.timer / self.cooldown
 end
 end
 
 
 return Smokescreen
 return Smokescreen

+ 22 - 0
data/skill/subterfuge.lua

@@ -0,0 +1,22 @@
+local Subterfuge = {}
+
+Subterfuge.name = 'Subterfuge'
+Subterfuge.code = 'subterfuge'
+Subterfuge.text = 'When you get a kill you cloak.'
+Subterfuge.type = 'passive'
+
+function Subterfuge:activate(owner)
+	ctx.event:on(evtDead, function(data)
+		if data.kill == owner.id then
+			ctx.buffs:add(owner, 'subterfuge')
+		end
+	end)
+end
+
+function Subterfuge:value(owner)
+  local buff = ctx.buffs:get(owner, 'subterfuge')
+  if buff then return buff.timer / buff.duration end
+  return 0
+end
+
+return Subterfuge

+ 30 - 0
data/spell/dagger.lua

@@ -0,0 +1,30 @@
+local Dagger = {}
+Dagger.code = 'dagger'
+Dagger.hp = .5
+
+function Dagger:activate(owner)
+  self.hp = Dagger.hp
+  
+  self.angle = self.owner.angle
+  self.x, self.y = self.owner.x + math.dx(35, self.angle), self.owner.y + math.dy(35, self.angle)
+  self.target = ctx.collision:circleTest(self.x, self.y, 14, {
+    tag = 'player',
+    fn = function(p) return p.team ~= self.owner.team end
+  })
+  
+  local backstab = false
+  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
+    local damage = data.weapon.dagger.damage
+    if backstab then damage = target.health end
+    ctx.net:emit(evtDamage, {id = self.target.id, amount = damage, from = self.owner.id, tick = tick})
+  end
+  
+  ctx.event:emit('sound.play', {sound = backstab and 'backstab' or 'slash'})
+end
+
+function Dagger:update(owner)
+  self.hp = timer.rot(self.hp, function() ctx.spells:deactivate(self) end)
+end
+
+return Dagger

+ 34 - 0
data/spell/dusk.lua

@@ -0,0 +1,34 @@
+local Dusk = {}
+
+Dusk.code = 'dusk'
+Dusk.distance = 160
+Dusk.speed = Dusk.distance * 10
+
+function Dusk:activate()
+  self.angle = self.owner.angle
+  self.health = Dusk.health
+  ctx.event:emit('sound.play', {sound = 'dash'})
+end
+
+function Dusk:update()
+  self.owner.x = self.owner.x + math.dx(self.speed * tickRate, self.angle)
+  self.owner.y = self.owner.y + math.dy(self.speed * tickRate, self.angle)
+  ctx.event:emit('collision.move', {object = self.owner, x = self.owner.x, y = self.owner.y})
+  ctx.collision:resolve(self.owner)
+  if self.owner.inputs then
+    table.insert(self.owner.inputs, {
+      tick = tick + 1,
+      reposition = {
+        x = self.owner.x,
+        y = self.owner.y
+      }
+    })
+  end
+
+  self.distance = self.distance - (self.speed * tickRate)
+  if self.distance <= 0 then
+    ctx.spells:deactivate(self)
+  end
+end
+
+return Dusk

+ 0 - 43
data/spell/knife.lua

@@ -1,43 +0,0 @@
-local Knife = {}
-Knife.code = 'knife'
-Knife.hp = .5
-
-function Knife:activate()
-  self.hp = Knife.hp
-  
-  self.angle = self.owner.angle
-  self.x, self.y = self.owner.x + math.dx(35, self.angle), self.owner.y + math.dy(35, self.angle)
-  self.target = ctx.collision:circleTest(self.x, self.y, 14, {
-    tag = 'player',
-    fn = function(p) return p.team ~= self.owner.team end
-  })
-  
-  local backstab = false
-  local shadowform = ctx.buffs:get(self.owner, 'shadowform')
-  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
-    local damage = data.weapon.knife.damage
-    if backstab then
-      local multiplier = 2
-      if shadowform then multiplier = multiplier + (1 - (self.target.health / self.target.maxHealth)) * 2 end
-      damage = damage * multiplier
-    end
-    ctx.net:emit(evtDamage, {id = self.target.id, amount = damage, from = self.owner.id, tick = tick})
-  end
-  
-  ctx.event:emit('sound.play', {sound = backstab and 'backstab' or 'slash'})
-end
-
-function Knife:update()
-  self.hp = timer.rot(self.hp, function() ctx.spells:deactivate(self) end)
-end
-
-function Knife:draw()
-  local alpha = 255 * (self.hp / Knife.hp) * self.owner.alpha
-  love.graphics.setColor(self.target and {0, 255, 0, alpha * (100 / 255)} or {255, 0, 0, alpha * (100 / 255)})
-  love.graphics.circle('fill', self.x, self.y, 12)
-  love.graphics.setColor(self.target and {0, 255, 0, alpha} or {255, 0, 0, alpha})
-  love.graphics.circle('line', self.x, self.y, 12)
-end
-
-return Knife

+ 0 - 29
data/spell/shadowdash.lua

@@ -1,29 +0,0 @@
-local ShadowDash = {}
-ShadowDash.code = 'shadowdash'
-ShadowDash.distance = 160
-ShadowDash.hp = .1
-
-function ShadowDash:activate()
-  self.hp = ShadowDash.hp
-  self.angle = self.owner.angle
-  ctx.event:emit('sound.play', {sound = 'dash'})
-  if ctx.buffs:get(self.owner, 'shadowform') then
-    self.owner.x = self.owner.x + math.dx(self.distance, self.angle)
-    self.owner.y = self.owner.y + math.dy(self.distance, self.angle)
-    ctx.collision:update()
-    ctx.spells:deactivate(self)
-  end
-end
-
-function ShadowDash:update()
-  self.hp = timer.rot(self.hp, function() ctx.spells:deactivate(self) end)
-  self.owner.x = self.owner.x + math.dx(self.distance / ShadowDash.hp * tickRate, self.angle)
-  self.owner.y = self.owner.y + math.dy(self.distance / ShadowDash.hp * tickRate, self.angle)
-  ctx.collision:update()
-end
-
-function ShadowDash:draw()
-  --
-end
-
-return ShadowDash

+ 9 - 17
data/spell/smokescreen.lua

@@ -1,31 +1,23 @@
-Smokescreen = {}
+local Smokescreen = {}
 
 
 Smokescreen.code = 'smokescreen'
 Smokescreen.code = 'smokescreen'
 Smokescreen.duration = 6
 Smokescreen.duration = 6
-Smokescreen.radius = 145
+Smokescreen.radius = 160
 Smokescreen.image = data.media.graphics.effects.smoke
 Smokescreen.image = data.media.graphics.effects.smoke
 
 
-function Smokescreen:activate()
+function Smokescreen:activate(mx, my)
   self.timer = self.duration
   self.timer = self.duration
   self.angle = love.math.random() * math.pi * 2
   self.angle = love.math.random() * math.pi * 2
-  self.x = self.owner.x
-  self.y = self.owner.y
-end
-
-function Smokescreen:deactivate()
-  ctx.players:each(function(p)
-    if ctx.buffs:get(p, 'smokescreen') then ctx.buffs:remove(p, 'smokescreen') end
-  end)
+  self.x, self.y = mx, my
 end
 end
 
 
 function Smokescreen:update()
 function Smokescreen:update()
-  ctx.players:each(function(p)
-    if p.team ~= self.owner.team and math.distance(self.x, self.y, p.x, p.y) < self.radius then
-      if not ctx.buffs:get(p, 'smokescreen') then ctx.buffs:add(p, 'smokescreen') end
-    else
-      if ctx.buffs:get(p, 'smokescreen') then ctx.buffs:remove(p, 'smokescreen') end
+  if self.owner.cloak < 1 then
+    if math.distance(self.x, self.y, self.owner.x, self.owner.y) < self.radius then
+      self.owner.cloak = math.min(self.owner.cloak + (3 * tickRate), 1)
     end
     end
-  end)
+  end
+
   self.timer = timer.rot(self.timer, function() ctx.spells:deactivate(self) end)
   self.timer = timer.rot(self.timer, function() ctx.spells:deactivate(self) end)
 end
 end
 
 

+ 32 - 0
data/weapon/dagger.lua

@@ -0,0 +1,32 @@
+local Weapon = {}
+
+Weapon.name = 'Dagger'
+Weapon.code = 'dagger'
+Weapon.text = 'Stabby'
+Weapon.type = 'weapon'
+
+Weapon.damage = 45
+Weapon.cooldown = .8
+
+function Weapon:activate(owner)
+  self.timer = 0
+end
+
+function Weapon:update(owner)
+  self.timer = timer.rot(self.timer)
+end
+
+function Weapon:canFire(owner)
+  return self.timer == 0
+end
+
+function Weapon:fire(owner)
+  ctx.spells:activate(self.id, data.spell.dagger)
+  self.timer = self.cooldown
+end
+
+function Weapon:draw(owner)
+  --
+end
+
+return Weapon

+ 0 - 32
data/weapon/knife.lua

@@ -1,32 +0,0 @@
-local Knife = {}
-
-Knife.name = 'Knife'
-Knife.code = 'knife'
-Knife.text = 'Stabby'
-Knife.type = 'weapon'
-
-Knife.damage = 45
-Knife.cooldown = .8
-
-function Knife:activate(knife)
-  knife.timer = 0
-end
-
-function Knife:update(knife)
-  knife.timer = timer.rot(knife.timer)
-end
-
-function Knife:canFire(knife)
-  return knife.timer == 0
-end
-
-function Knife:fire(knife)
-  ctx.spells:activate(self.id, data.spell.knife)
-  knife.timer = knife.cooldown
-end
-
-function Knife:draw(knife)
-  --
-end
-
-return Knife