extends Node

var counter = 0
var score = {}
var xp = {}
var nxt = {}
var lv = {}
var maxhp = {}
export var hpgain = 5
export var dmggain = 5
export var xpggain = 10
export var xpnext = 1.2
export var enemydmg = 3.0
func death_count(id):
	if not nxt.has(id):
		nxt[id] = 100
	
	if not maxhp.has(id):
		maxhp[id] = 100
	
	if not lv.has(id):
		lv[id] = 0
	
	if score.has(id):
		score[id] += 1
	else:
		score[id] = 1
	
	if xp.has(id):
		xp[id] += xpggain
		if xp[id] > nxt[id]:
			lv[id] += 1
			var gain = hpgain * lv[id]
			maxhp[id] += gain
			get_parent().level_up(lv[id] , maxhp[id], gain, dmggain, id)
			xp[id] = 0
			nxt[id] *= xpnext
	else:
		xp[id] = xpggain
	get_parent().kill_update(score[id], xp[id], lv[id], nxt[id], id)
