Split evadventure combat code into several modules

This commit is contained in:
Griatch 2023-04-09 11:11:58 +02:00
parent 6a4f293ab9
commit 049e4fbb35
5 changed files with 1905 additions and 1617 deletions

View file

@ -6,7 +6,6 @@ added to all game objects. You access it through the property
"""
from django.utils.translation import gettext as _
from evennia.scripts.models import ScriptDB
from evennia.utils import create, logger
@ -112,6 +111,19 @@ class ScriptHandler(object):
num += 1
return num
def has(self, key):
"""
Determine if a given script exists on this object.
Args:
key (str): Search criterion, the script's key or dbref.
Returns:
bool: If the script exists or not.
"""
return ScriptDB.objects.get_all_scripts_on_obj(self.obj, key=key).exists()
def get(self, key):
"""
Search scripts on this object.