python/events/gkill/reputation.py
raw| 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 | killer = get_killer(Crossfire.WhoIsActivator()) |
| 14 | victim = Crossfire.WhoAmI() |
| 15 | |
| 16 | if is_player(killer): |
| 17 | CFReputation.record_kill(victim.Race, victim.Map.Region.Name, killer.Name) |