Crossfire Server, Trunk
reputation.py
Go to the documentation of this file.
1 import Crossfire
2 import CFReputation
3 
4 def get_killer(hitter):
5  owner = hitter.Owner
6  if owner is not None:
7  return owner
8  return hitter
9 
10 def is_player(op):
11  return op.Type == Crossfire.Type.PLAYER
12 
13 def on_kill():
14  killer = get_killer(Crossfire.WhoIsActivator())
15  victim = Crossfire.WhoAmI()
16 
17  if is_player(killer):
18  CFReputation.record_kill(victim.Race, victim.Map.Region.Name, killer.Name)
19 
20 # disabled by default, doesn't currently have a big in-game impact and has a
21 # pretty significant performance hit
22 #on_kill()
CFReputation.record_kill
def record_kill(race, region, player, fraction=0.0001, limit=0.4)
Definition: __init__.py:71
reputation.on_kill
def on_kill()
Definition: reputation.py:13
reputation.get_killer
def get_killer(hitter)
Definition: reputation.py:4
reputation.is_player
def is_player(op)
Definition: reputation.py:10