def __init__(self, id, cost, prerequisites, danger, effect_data): super(TechSpec, self).__init__(id, cost, prerequisites) self.result = "" self.danger = danger self.effect = effect.Effect(self, effect_data)
def __init__(self, id, event_type, effect_data, chance, duration, unique): super(EventSpec, self).__init__(id) self.event_type = event_type self.description = "" self.log_description = "" self.effect = effect.Effect(self, effect_data) self.chance = chance self.duration = duration if duration > 0 else None self.unique = unique if duration < 1 and not unique: raise ValueError("Event %s must have either a non-zero duration (e.g. duration = 21) or be unique " "(unique = 1)")