示例#1
0
文件: items.py 项目: flags/Reactor-3
def process_event(item, event):
	if event == 'equip' and 'ON_EQUIP' in item['flags']:
		scripting.execute(item['flags']['ON_EQUIP'], item_uid=item['uid'])
	
	elif event == 'activate' and 'ON_ACTIVATE' in item['flags']:
		scripting.execute(item['flags']['ON_ACTIVATE'], item_uid=item['uid'])
	
	elif event == 'deactivate' and 'ON_DEACTIVATE' in item['flags']:
		scripting.execute(item['flags']['ON_DEACTIVATE'], item_uid=item['uid'])
	
	elif event == 'stop' and 'ON_STOP' in item['flags']:
		scripting.execute(item['flags']['ON_STOP'], item_uid=item['uid'])
	
	elif event == 'collide' and 'ON_COLLIDE_WITH' in item['flags']:
		scripting.execute(item['flags']['ON_COLLIDE_WITH'], item_uid=item['uid'])
示例#2
0
def process_event(item, event):
	if event == 'equip' and 'ON_EQUIP' in item['flags']:
		scripting.execute(item['flags']['ON_EQUIP'], item_uid=item['uid'])
	
	elif event == 'activate' and 'ON_ACTIVATE' in item['flags']:
		scripting.execute(item['flags']['ON_ACTIVATE'], item_uid=item['uid'])
	
	elif event == 'deactivate' and 'ON_DEACTIVATE' in item['flags']:
		scripting.execute(item['flags']['ON_DEACTIVATE'], item_uid=item['uid'])
	
	elif event == 'stop' and 'ON_STOP' in item['flags']:
		scripting.execute(item['flags']['ON_STOP'], item_uid=item['uid'])
	
	elif event == 'collide' and 'ON_COLLIDE_WITH' in item['flags']:
		scripting.execute(item['flags']['ON_COLLIDE_WITH'], item_uid=item['uid'])
示例#3
0
def dismantle_item(life, item_id):
	_item = lfe.get_inventory_item(life, item_id)
	
	scripting.execute(_item['flags']['CANDISMANTLE'], owner=life, item_uid=item_id)