コード例 #1
0
ファイル: summary.py プロジェクト: ssw-parser/SSW_Parser
def create_speed_list_item(mech, i, var):
    """
    Compile info used by print_speed_list()
    """
    name_str = mech.name + " " + mech.model + i.get_name()
    batt_val = mech.get_bv(i)
    weight = mech.weight
    walk = mech.get_walk()
    run = mech.get_run()
    jump = i.get_jump()
    spd = max(walk, jump)
    if mech.type == "BM":
        enh = mech.enhancement.get_type()
    else:
        enh = ""
    mod = mech.get_move_target_modifier(i)
    batt_f = BattleForce(mech, i)
    bf_str = batt_f.get_move()
    osf = mech.get_off_speed_factor(i, False)
    sup = ""
    if i.gear.supercharger.supercharger:
        sup = "SupC"
    eng_s = mech.engine.short

    return (name_str, weight, batt_val, spd, walk, run, jump, enh, eng_s, mod, bf_str, osf, sup)
コード例 #2
0
ファイル: summary.py プロジェクト: ssw-parser/SSW_Parser
def create_armor_list_item(mech, i, var):
    """
    Compile info used by print_armor_list()
    """
    name_str = mech.name + " " + mech.model + i.get_name()
    batt_val = mech.get_bv(i)
    weight = mech.weight
    # Armor coverage relative to maximum
    armor = mech.armor.get_armor_percent()
    # Check for explosive stuff that can disable the mech
    exp = i.gear.get_ammo_exp_bv(mech.engine) + i.gear.get_weapon_exp_bv(mech.engine)
    if exp < 0:
        e_str = "EXP"
    else:
        e_str = ""
    # Check for a stealth system
    sth = mech.get_stealth()
    if sth:
        s_str = "STH"
    else:
        s_str = ""
    # Armor points
    arm_p = mech.armor.total.arm
    max_p = mech.armor.total.max
    # Armor weight
    wgt = mech.armor.get_weight()
    # BF armor
    batt_f = BattleForce(mech, i)
    bf_a = batt_f.get_armor()
    short = mech.armor.short

    return (name_str, weight, batt_val, arm_p, max_p, armor, wgt, short, bf_a, e_str, s_str)
コード例 #3
0
ファイル: type.py プロジェクト: ssw-parser/SSW_Parser
    def is_brawler(self):
        """
        Check if a mech is a brawler

        Definition:
        - Speed at least walk 4 or jump 4
        - BF armor at least 4
        - Able to do 10 damage at range 15
        - Do more damage at range 15 than range 18
        """
        if self.mech.get_walk() < 4 and self.load.get_jump() < 4:
            return False

        batt_f = BattleForce(self.mech, self.load)
        if batt_f.get_armor() < 4:
            return False

        dam15 = self.load.gear.weaponlist.count_damage(15)
        if dam15 < 10:
            return False

        if self.load.gear.weaponlist.count_damage(18) >= dam15:
            return False

        return True
コード例 #4
0
ファイル: report.py プロジェクト: ssw-parser/SSW_Parser
def parse_armor(mech):
    """
    Parse the armor of a mech.
    """
    # Standard armor report
    mech.armor.parse_armor()
    # Battle force armor
    batt_f = BattleForce(mech, mech.load)
    print "BF Armor: ", batt_f.get_armor()
コード例 #5
0
ファイル: summary.py プロジェクト: ssw-parser/SSW_Parser
def create_battle_force_list_item(mech, i, var):
    """
    Compile info used by print_battle_force_list()
    """
    name_str = mech.name + " " + mech.model + i.get_name()
    batt_f = BattleForce(mech, i)
    batt_val = batt_f.get_point_value()
    weight = batt_f.get_weight_class()
    mov = batt_f.get_move()
    armor = batt_f.get_armor()

    return (name_str, weight, batt_val, mov, armor)
コード例 #6
0
ファイル: type.py プロジェクト: ssw-parser/SSW_Parser
    def is_skirmisher(self):
        """
        Check if a mech is a skirmisher

        Definition:
        - Speed at least walk 5 or jump 5
        - BF armor at least 3
        - Able to do 5 damage at range 15
        """
        if self.mech.get_walk() < 5 and self.load.get_jump() < 5:
            return False

        batt_f = BattleForce(self.mech, self.load)
        if batt_f.get_armor() < 3:
            return False

        if self.load.gear.weaponlist.count_damage(15) < 5:
            return False

        return True
コード例 #7
0
ファイル: type.py プロジェクト: ssw-parser/SSW_Parser
    def is_juggernaut(self):
        """
        Check if a mech is a juggernaut

        Definition:
        - Walking and jump speed no more than 4
        - BF armor at least 5
        - Able to do 30 damage at range 6
        - Do less than 20 damage at range 18
        """
        if self.mech.get_walk() > 4 or self.load.get_jump() > 4:
            return False

        batt_f = BattleForce(self.mech, self.load)
        if batt_f.get_armor() < 5:
            return False

        if self.load.gear.weaponlist.count_damage(6) < 30:
            return False

        if self.load.gear.weaponlist.count_damage(18) >= 20:
            return False

        return True