当前位置: 首页>>代码示例>>C++>>正文


C++ FunctionContext::getTriggerer方法代码示例

本文整理汇总了C++中aurora::nwscript::FunctionContext::getTriggerer方法的典型用法代码示例。如果您正苦于以下问题:C++ FunctionContext::getTriggerer方法的具体用法?C++ FunctionContext::getTriggerer怎么用?C++ FunctionContext::getTriggerer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aurora::nwscript::FunctionContext的用法示例。


在下文中一共展示了FunctionContext::getTriggerer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: actionDoCommand

void Functions::actionDoCommand(Aurora::NWScript::FunctionContext &ctx) {
	Common::UString script = ctx.getScriptName();
	if (script.empty())
		throw Common::Exception("Functions::actionDoCommand(): Script needed");

	const Aurora::NWScript::ScriptState &state = ctx.getParams()[0].getScriptState();

	_game->getModule().delayScript(script, state, ctx.getCaller(), ctx.getTriggerer(), 0);
}
开发者ID:Supermanu,项目名称:xoreos,代码行数:9,代码来源:functions_action.cpp

示例2: beginConversation

void Functions::beginConversation(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = 0;

	// Get the script object parameters
	Aurora::NWScript::Object *obj1 = ctx.getCaller();
	Aurora::NWScript::Object *obj2 = getParamObject(ctx, 1);
	if (!obj2)
		obj2 = ctx.getTriggerer();
	if (!obj2)
		obj2 = _game->getModule().getPC();

	// Try to convert them to an NWN Creature and Object
	NWN::Creature *pc     = NWN::ObjectContainer::toPC(obj2);
	NWN::Object   *object = NWN::ObjectContainer::toObject(obj1);

	// Try the other way round, if necessary
	if (!pc || !object) {
		pc     = NWN::ObjectContainer::toPC(obj1);
		object = NWN::ObjectContainer::toObject(obj2);
	}

	// Fail
	if (!pc || !object)
		return;

	if (object->getPCSpeaker()) {
		if (object->getPCSpeaker() != pc) {
			Creature *otherPC = NWN::ObjectContainer::toPC(object->getPCSpeaker());

			warning("Functions::beginConversation(): "
			        "Object \"%s\" already in conversation with PC \"%s\"",
			        object->getTag().c_str(), otherPC ? otherPC->getName().c_str() : "");
			return;
		}
	}

	Common::UString conversation = ctx.getParams()[0].getString();
	if (conversation.empty())
		conversation = object->getConversation();

	ctx.getReturn() = _game->getModule().startConversation(conversation, *pc, *object);
}
开发者ID:Supermanu,项目名称:xoreos,代码行数:42,代码来源:functions_conversation.cpp

示例3: getExitingObject

void Functions::getExitingObject(Aurora::NWScript::FunctionContext &ctx) {
	// TODO: This should return the *last* exited object, i.e. it should remember past triggerers.
	ctx.getReturn() = ctx.getTriggerer();
}
开发者ID:mirv-sillyfish,项目名称:xoreos,代码行数:4,代码来源:functions_object.cpp

示例4: getClickingObject

void Functions::getClickingObject(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = ctx.getTriggerer();
}
开发者ID:mirv-sillyfish,项目名称:xoreos,代码行数:3,代码来源:functions_object.cpp


注:本文中的aurora::nwscript::FunctionContext::getTriggerer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。