deathmatch.lua 463 B

1234567891011121314151617
  1. local Deathmatch = {}
  2. Deathmatch.code = 'deathmatch'
  3. Deathmatch.pointsPerKill = 1
  4. Deathmatch.experiencePerKill = 0
  5. function Deathmatch:init()
  6. ctx.event:on(app.net.events.dead, function(data)
  7. if data.id == data.kill then return end
  8. local killer = ctx.players:get(data.kill)
  9. ctx.map:modExec('scoring', 'score', killer.team, self.pointsPerKill)
  10. ctx.map:modExec('experience', 'give', killer, self.experiencePerKill)
  11. end)
  12. end
  13. return Deathmatch