Package horizons :: Package world :: Package disaster :: Module blackdeathdisaster :: Class BlackDeathDisaster
[hide private]
[frames] | no frames]

Class BlackDeathDisaster

source code

         util.changelistener.ChangeListener --+            
                                              |            
                   util.worldobject.WorldObject --+        
                                                  |        
                                           Disaster --+    
                                                      |    
buildinginfluencingdisaster.BuildingInfluencingDisaster --+
                                                          |
                                                         BlackDeathDisaster

Simulates the Black Death.

Instance Methods [hide private]
 
__init__(self, settlement, manager) source code
 
infect(self, building, load=None)
Used to expand disaster to this building.
source code
 
wreak_havoc(self, building)
Some inhabitants have to die.
source code
 
recover(self, building)
Inverse of infect().
source code
    Inherited from buildinginfluencingdisaster.BuildingInfluencingDisaster
 
breakout(self)
Picks (a) object(s) to start a breakout.
source code
 
end(self)
End this class, used for cleanup.
source code
 
evaluate(self)
Called to evaluate if this disaster is still active
source code
 
expand(self)
Called to make the disaster expand further
source code
 
load(self, db, worldid) source code
 
save(self, db) source code
    Inherited from util.worldobject.WorldObject
 
__lt__(self, other) source code
 
remove(self) source code
    Inherited from util.changelistener.ChangeListener
 
_changed(self)
Calls every listener when an object changed
source code
 
add_change_listener(self, listener, call_listener_now=False, no_duplicates=False) source code
 
add_remove_listener(self, listener, no_duplicates=False)
A listener that listens for removal of the object
source code
 
clear_change_listeners(self)
Removes all change listeners
source code
 
discard_change_listener(self, listener)
Remove listener if it's there
source code
 
discard_remove_listener(self, listener) source code
 
has_change_listener(self, listener) source code
 
has_remove_listener(self, listener) source code
 
remove_change_listener(self, listener) source code
 
remove_remove_listener(self, listener) source code
Class Methods [hide private]
    Inherited from buildinginfluencingdisaster.BuildingInfluencingDisaster
 
can_breakout(cls, settlement)
Returns whether or not a disaster can break out in the settlement
source code
    Inherited from util.worldobject.WorldObject
 
get_object_by_id(cls, id)
Returns the worldobject with id id Throws WorldObjectNotFound with the worldid as arg.
source code
 
get_objs(cls) source code
 
reset(cls) source code
Class Variables [hide private]
  TYPE = "Happy dying."
hash(x)
  NOTIFICATION_TYPE = 'BUILDING_INFECTED_BY_BLACK_DEATH'
  SEED_CHANCE = 0.015
  EXPANSION_RADIUS = 4
  DISASTER_RES = 98
hash(x)
  BUILDING_TYPE = 3
  MIN_BREAKOUT_TIER = 2
hash(x)
  MIN_INHABITANTS_FOR_BREAKOUT = 5
  STATUS_ICON = BlackDeathStatusIcon
hash(x)
  RESCUE_BUILDING_TYPE = 42
hash(x)
    Inherited from buildinginfluencingdisaster.BuildingInfluencingDisaster
  EXPANSION_TIME = TIME_BEFORE_HAVOC// 2-1
  TIME_BEFORE_HAVOC = GAME_SPEED.TICKS_PER_SECOND* 30
    Inherited from Disaster
  log = logging.getLogger("world.disaster")
Method Details [hide private]

__init__(self, settlement, manager)
(Constructor)

source code 
Parameters:
  • settlement - Settlement instance this disaster operates on
  • manager - The disaster manager that initiated this disaster
Overrides: util.changelistener.ChangeListener.__init__

infect(self, building, load=None)

source code 

Used to expand disaster to this building. Usually called by expand and breakout

Overrides: Disaster.infect

wreak_havoc(self, building)

source code 

Some inhabitants have to die.

Overrides: Disaster.wreak_havoc

recover(self, building)

source code 

Inverse of infect(). Is also called when buildings are torn down by the user.

Overrides: Disaster.recover
(inherited documentation)