Exemple #1
0
    def patch_resource_database(
            self, db: ResourceDatabase,
            configuration: BaseConfiguration) -> ResourceDatabase:
        base_damage_reduction = db.base_damage_reduction
        damage_reductions = copy.copy(db.damage_reductions)
        requirement_template = copy.copy(db.requirement_template)

        suits = [db.get_item_by_name("Varia Suit")]
        if configuration.heat_protection_only_varia:
            requirement_template["Heat-Resisting Suit"] = ResourceRequirement(
                db.get_item_by_name("Varia Suit"), 1, False)
        else:
            suits.extend([
                db.get_item_by_name("Gravity Suit"),
                db.get_item_by_name("Phazon Suit")
            ])

        reductions = [DamageReduction(None, configuration.heat_damage / 10.0)]
        reductions.extend([DamageReduction(suit, 0) for suit in suits])
        damage_reductions[db.get_by_type_and_index(ResourceType.DAMAGE,
                                                   "HeatDamage1")] = reductions

        if configuration.progressive_damage_reduction:
            base_damage_reduction = self.prime1_progressive_damage_reduction
        else:
            base_damage_reduction = self.prime1_absolute_damage_reduction

        return dataclasses.replace(db,
                                   damage_reductions=damage_reductions,
                                   base_damage_reduction=base_damage_reduction,
                                   requirement_template=requirement_template)
Exemple #2
0
 def prime1_absolute_damage_reduction(self, db: ResourceDatabase, current_resources: ResourceCollection):
     if current_resources[db.get_item_by_name("Phazon Suit")] > 0:
         return 0.5
     elif current_resources[db.get_item_by_name("Gravity Suit")] > 0:
         return 0.8
     elif current_resources[db.get_item_by_name("Varia Suit")] > 0:
         return 0.9
     else:
         return 1
Exemple #3
0
 def patch_resource_database(
         self, db: ResourceDatabase,
         configuration: BaseConfiguration) -> ResourceDatabase:
     damage_reductions = copy.copy(db.damage_reductions)
     damage_reductions[db.get_by_type_and_index(
         ResourceType.DAMAGE, "DarkWorld1")] = [
             DamageReduction(None, configuration.varia_suit_damage / 6.0),
             DamageReduction(db.get_item_by_name("Dark Suit"),
                             configuration.dark_suit_damage / 6.0),
             DamageReduction(db.get_item_by_name("Light Suit"), 0.0),
         ]
     return dataclasses.replace(db, damage_reductions=damage_reductions)
Exemple #4
0
 def prime1_progressive_damage_reduction(self, db: ResourceDatabase, current_resources: ResourceCollection):
     num_suits = sum(current_resources[db.get_item_by_name(suit)]
                     for suit in ["Varia Suit", "Gravity Suit", "Phazon Suit"])
     if num_suits >= 3:
         return 0.5
     elif num_suits == 2:
         return 0.8
     elif num_suits == 1:
         return 0.9
     else:
         return 1
def create_nothing_pickup(resource_database: ResourceDatabase) -> PickupEntry:
    """
    Creates a Nothing pickup.
    :param resource_database:
    :return:
    """
    return PickupEntry(
        name="Nothing",
        progression=((resource_database.get_item_by_name("Nothing"), 1), ),
        model=PickupModel(
            game=resource_database.game_enum,
            name="Nothing",
        ),
        item_category=USELESS_ITEM_CATEGORY,
        broad_category=USELESS_ITEM_CATEGORY,
    )
Exemple #6
0
def create_prime1_useless_pickup(resource_database: ResourceDatabase) -> PickupEntry:
    """
    Creates a Nothing pickup.
    :param resource_database:
    :return:
    """
    return PickupEntry(
        name="Nothing",
        progression=(
            (resource_database.get_item_by_name("Nothing"), 1),
        ),
        model=PickupModel(
            game=resource_database.game_enum,
            name="Nothing",
        ),
        item_category=ItemCategory.ETM,
        broad_category=ItemCategory.ETM,
    )