""" fire.py
 Copyright (C) 1998 Aloril
 
 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; either version 2 of the License, or
 (at your option) any later version.
 
 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.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
"""

import whrandom
from thing import thing
import prob
from event import *
from fire import fire

class house(thing):
    def fire_event(self, e):
        return [event("change",what=self, amount=-0.2*e.amount, target=self)]
    def run_step(self,time,input):
        #input
        output=self.analyse_input(input)
        if output: return output
        #if hasattr(self,"fire"):
        if prob.does_it_happen(prob.fire_probability):
            #set fire to house
            f=fire(name='fire',desc='semilive thing',place=self,status=0.0)
            return [event("make",what=f)]

    Source: geocities.com/siliconvalley/station/4279/src

               ( geocities.com/siliconvalley/station/4279)                   ( geocities.com/siliconvalley/station)                   ( geocities.com/siliconvalley)