Example #1
0
def parseKill(inp):
	#Kill: 1 0 15: WolfXxXBunny killed [WoC]*B1naryth1ef by UT_MOD_DEAGLE
	inp = inp.split(" ")
	inp.pop(0)
	attacker = int(inp[0])
	if attacker == 1022: atkobj = None #We're world. Setting this None might break shit (but hopefully not)
	else: atkobj = BOT.Clients[attacker] #We're a player
	victim = int(inp[1])
	vicobj = BOT.Clients[victim]
	method = int(inp[2][:-1])
	if method in [1, 3, 9, 39]: BOT.eventFire('CLIENT_WORLDDEATH', {'vic':victim, 'meth':method})
	elif method in [7, 6, 10, 31, 32]: 
		BOT.eventFire('CLIENT_SUICIDE', {'vic':victim, 'meth':method})
		if method == 10 and atkobj.team != 'spec':
			BOT.eventFire('CLIENT_SWITCHTEAM', {'client':attacker, 'fromteam':atkobj.team, 'toteam':None})
			atkobj.team = const.switchTeam(atkobj.team)
	elif atkobj.team == vicobj.team and atkobj.name != vicobj.name: BOT.eventFire('CLIENT_TEAMKILL', {'atk':attacker, 'vic':victim, 'meth':method})
	else:
		BOT.eventFire('CLIENT_KILL', {'atk':attacker, 'vic':victim, 'meth':method})
		BOT.eventFire('CLIENT_GENERICDEATH', {'vic':victim})
Example #2
0
 def die(self, meth):
     if meth == 10:
         if self.team == SPEC_TEAM:
             pass
         else:
             self.team = const.switchTeam(self.team)