"""
shot.py - general shot type class - do not instantiate
"""

import common
import object
import pygame

class Shot(object.Object):

    def __init__(self,owner,rect):
        object.Object.__init__(self,rect,1)
        self.owner = owner
        self.damage = 0

    def kill(self):
        if hasattr(self,'last_rect'):
            r = self.last_rect
        else: r = self.rect
        self.hide()
        r = self.optimizeDirtyRect(r)
        pygame.display.update(r)

        if not common.speed:
            self.explode()
            common.sound.explode()
        
        if self.owner == 0:
            common.shots_player.remove(self)            
        else:
            common.shots_enemy.remove(self)

    #
    # Override these functions!
    #
    def explode(self):
        pass
    
