コード例 #1
0
ファイル: scriptlib.py プロジェクト: fabr1z10/glib3
def walk_to(item_id):
    # now get the walk_to for this item
    s = Script(uid='_main')
    # if you own the item, no need to walk
    if item_id in mopy.monkey.engine.data.globals.inventory:
        return s
    item = sc.get_item(item_id)
    pos = item.get('walk_to')
    wdir = item.get('wdir', None)
    s.add_action(Walk(pos, 'player'))
    if wdir:
        s.add_action(Turn(wdir, 'player'))
    return s
コード例 #2
0
ファイル: scriptmake.py プロジェクト: fabr1z10/glib3
def wti(args, s, current, sa):
    # if you own the item, no need to walk
    # you can override the item via 2nd argument
    item_id = args[0] if len(args) >= 1 else sa[0]
    if item_id in mopy.monkey.engine.data.globals.inventory:
        iid = s.add_action(NoOp())
        return iid
    item = sc.get_item(item_id)
    pos = item.get('walk_to')
    wdir = item.get('wdir', None)
    iid = s.add_action(Walk(pos, 'player'))
    if wdir:
        iid = s.add_action(Turn(wdir, 'player'), after=[iid])
    return iid
コード例 #3
0
def _select__walkdoor(args):
    door_id = sc.get_item(args[0])['door']
    if getattr(doors, door_id) == 'open':
        return 1
    return 0
コード例 #4
0
ファイル: scriptmake.py プロジェクト: fabr1z10/glib3
def clo(args, s, current, sa):
    item_id = args[0] if len(args) > 0 else sa[0]
    door_id = sc.get_item(item_id)['door']
    iid = s.add_action(close_door(item_id, door_id))
    return iid