davedotluebke / old-skool-text-game

Coding project used to learn Python
5 stars 4 forks source link

Give everything spawning values #120

Open rivques opened 5 years ago

rivques commented 5 years ago

This is just like #93. The code for spawning works, but we need to go through every room in the game and give each object a respawn interval and message. We also need to see if we want everything to have the same respawn frequency and/or message or not. Currently, the way to set up spawning for an object is as follows: I'll use the potion book in the library as an example.

    potion_book = gametools.clone('domains.school.school.potion_book')
    potion_book.set_spawn_interval(300)
    potion_book.set_spawn_message("A new tome pops into being!")
    library.set_spawn(potion_book)
    library.insert(potion_book)

An interval of None and/or not calling set_spawn() means that the item will not respawn (default)