コード例 #1
0
ALivingEntity::ALivingEntity() : Super()
{
	CurrentEntityType = EntityEnums::Living;
	AIControllerClass = ACombatAIController::StaticClass();
	EntityComboManager = new ComboManager(this);
	health = 1000;
	entityName = "Test";
	clan = "2";
	currentHealth = health;
	rollDistance = 400;
	rollVelocity = 300;

	UChoiceResponse* start = new UChoiceResponse("Hello");
	UChoiceResponse* middle = new UChoiceResponse("Greg");
	UChoiceResponse* end = new UChoiceResponse("Good bye");

	UConversationChoice* name = new UConversationChoice("What's you're name?");
	name->SetResponse(middle);

	UConversationChoice* sorry = new UConversationChoice("Sorry to disturb you, cya");
	sorry->SetResponse(end);

	start->AddChoice(name);
	start->AddChoice(sorry);

	middle->AddChoice(sorry);

	SetConversation(new UConversation(start));
}
コード例 #2
0
ファイル: p_usdf.cpp プロジェクト: DaZombieKiller/lxDoom
	bool ParseConversation()
	{
		const PClass *type = NULL;
		int dlgid = -1;
		unsigned int startpos = StrifeDialogues.Size();

		while (!sc.CheckToken('}'))
		{
			bool block = false;
			FName key = ParseKey(true, &block);
			if (!block)
			{
				switch(key)
				{
				case NAME_Actor:
					type = CheckActorType(key);
					if (namespace_bits == St)
					{
						dlgid = CheckInt(key);
					}
					break;

				case NAME_Id:
					if (namespace_bits == Zd)
					{
						dlgid = CheckInt(key);
					}
					break;
				}
			}
			else
			{
				switch(key)
				{
				case NAME_Page:
					if (!ParsePage()) return false;
					break;

				default:
					sc.UnGet();
					Skip();
				}
			}
		}
		if (type == NULL && dlgid == 0)
		{
			sc.ScriptMessage("No valid actor type defined in conversation.");
			return false;
		}
		SetConversation(dlgid, type, startpos);
		for(;startpos < StrifeDialogues.Size(); startpos++)
		{
			StrifeDialogues[startpos]->SpeakerType = type;
		}
		return true;
	}