# # Effect.py # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # Copyright # Author: Salvatore S. Gionfriddo # Contributors: Nicholas F. Hoover # Created: 2007.07.04 # Last Modified: 2007.07.24 # class Effect: def __init__(self, name, life): self.name = name self.age = 0 # how long have you persisted? self.life = life # how long do you persist? # Instant Effect self.i_change = None self.i_change_amount = 0 # Durational Effect self.change = None #the function that you call self.change_amount = 0 # End Effect self.e_change = None self.e_change_amount = 0 class DrugEffect(Effect): def __init__(self): Effect.__init__(self, "Drugs", 2) # Instant Effect self.i_change = "incHealth" self.i_change_amount = 10 # Durational Effect self.change = "decHealth" #the function that you call self.change_amount = 10 # End Effect self.e_change = "incHealth" self.e_change_amount = 100 class PizzaEffect(Effect): def __init__(self): Effect.__init__(self, "Pizza", 0) # Instant Effect self.i_change = "incHunger" self.i_change_amount = 25 class TacosEffect(Effect): def __init__(self): Effect.__init__(self, "Tacos", 0) # Instant Effect self.i_change = "incGas" self.i_change_amount = 20 class HungerBoost(Effect): def __init__(self, amount = 3): Effect.__init__(self, "Hunger Boost", 0) # Instant Effect self.i_change = "incHunger" self.i_change_amount = amount class HealthBoost(Effect): def __init__(self, amount = 2): Effect.__init__(self, "Health Boost", 0) #instant Effect self.i_change = "incHealth" self.i_change_amount = amount class HeartBurn(Effect): def __init__(self): Effect.__init__(self, "Heart Burn", 5) # Instant Effect self.i_change = "setHeartBurn" self.i_change_amount = True # Durational Effect self.change = "setHeartBurn" self.change_amount = True