2016
03.27

lights update

I’ve just pushed a new version with various improvements :

  • candles and torchs burn away. You can see how much remains in the inventorytorch_inv
  • lanterns can now be refilled with oil flasks

On the implementation side, most of this relies on the existing actor features : destructible, ai and conditions. A torch is an actor with an Ai (because it needs to update every turn). It is destructible and has health points and a permanent condition that decreases its health points. The absence of corpse name for this actor means it is simply destroyed when its health points reach 0.

As for the lantern, the oil flask has a onUseEffector that “heals” actors of a specific type, pretty much like the health potion except it does not apply on the potion wearer but on an item from its inventory. Right now this only works when you have only one lantern in your inventory. I still need to handle the case where you would have to choose an item.

 

No Comment.

Add Your Comment