evennia.contrib.tutorials.evadventure.utils¶
Various utilities.
-
evennia.contrib.tutorials.evadventure.utils.
get_obj_stats
(obj, owner=None)[源代码]¶ Get a string of stats about the object.
- 参数
obj (EvAdventureObject) – The object to get stats for.
owner (EvAdventureCharacter, optional) – If given, it allows us to also get information about if the item is currently worn/wielded.
- 返回
str – A stat string to show about the object.
-
evennia.contrib.tutorials.evadventure.utils.
random_probability
(self, probabilities)[源代码]¶ Given a dictionary of probabilities, return the key of the chosen probability.
- 参数
probabilities (dict) – A dictionary of probabilities, where the key is the action and the value is the probability of that action.