Exemple #1
0
class WeaponSpec(Struct):
    def __init__(self, cont=None, name=""):
        Struct.__init__(self, "CDataWeaponspec")
        self.name = String(name)
        self.sprite_body = Pointer(Sprite, Sprite())
        self.sprite_cursor = Pointer(Sprite, Sprite())
        self.sprite_proj = Pointer(Sprite, Sprite())
        self.sprite_muzzles = Array(Pointer(Sprite, Sprite()))
        self.visual_size = Int(96)

        self.firedelay = Int(500)
        self.maxammo = Int(10)
        self.ammoregentime = Int(0)
        self.damage = Int(1)

        self.offsetx = Float(0)
        self.offsety = Float(0)
        self.muzzleoffsetx = Float(0)
        self.muzzleoffsety = Float(0)
        self.muzzleduration = Float(5)

        # dig out sprites if we have a container
        if cont:
            for sprite in cont.sprites.items:
                if sprite.name.value == "weapon_" + name + "_body":
                    self.sprite_body.Set(sprite)
                elif sprite.name.value == "weapon_" + name + "_cursor":
                    self.sprite_cursor.Set(sprite)
                elif sprite.name.value == "weapon_" + name + "_proj":
                    self.sprite_proj.Set(sprite)
                elif "weapon_" + name + "_muzzle" in sprite.name.value:
                    self.sprite_muzzles.Add(Pointer(Sprite, sprite))
Exemple #2
0
 def __init__(self):
     Struct.__init__(self, "CDataWeaponspecLaser")
     self.base = Pointer(WeaponSpec, WeaponSpec())
     self.reach = Float(800.0)
     self.bounce_delay = Int(150)
     self.bounce_num = Int(1)
     self.bounce_cost = Float(0)
Exemple #3
0
 def __init__(self):
     Struct.__init__(self, "CDataWeaponspecShotgun")
     self.base = Pointer(WeaponSpec, WeaponSpec())
     self.curvature = Float(1.25)
     self.speed = Float(2200)
     self.speeddiff = Float(0.8)
     self.lifetime = Float(0.25)
Exemple #4
0
 def __init__(self, name="", Set=None, x=0, y=0, w=0, h=0):
     Struct.__init__(self, "CDataSprite")
     self.name = String(name)
     self.set = Pointer(SpriteSet, Set)  # TODO
     self.x = Int(x)
     self.y = Int(y)
     self.w = Int(w)
     self.h = Int(h)
Exemple #5
0
 def __init__(self, _name="", image=None, gridx=0, gridy=0):
     Struct.__init__(self, "CDataSpriteset")
     self.image = Pointer(Image, image)  # TODO
     self.gridx = Int(gridx)
     self.gridy = Int(gridy)
Exemple #6
0
 def __init__(self):
     Struct.__init__(self, "CDataWeaponspecNinja")
     self.base = Pointer(WeaponSpec, WeaponSpec())
     self.duration = Int(15000)
     self.movetime = Int(200)
     self.velocity = Int(50)
Exemple #7
0
 def __init__(self):
     Struct.__init__(self, "CDataWeaponspecGrenade")
     self.base = Pointer(WeaponSpec, WeaponSpec())
     self.curvature = Float(7.0)
     self.speed = Float(1000)
     self.lifetime = Float(2.0)
Exemple #8
0
 def __init__(self):
     Struct.__init__(self, "CDataWeaponspecHammer")
     self.base = Pointer(WeaponSpec, WeaponSpec())