Ultima Underworld/technical/conversations/231
Technical Details Warning |
While the encyclopedic nature of the codex means that many articles will have information that could spoil some minor aspects of the game for newer players, this article is known to contain technical information about the game, game engine, data files, logic, etc. This information is not generally useful to the typical game players.
Continue reading at your own discretion. |
This page contains decompiled conversation code from Ultima Underworld. The original files came from Paul Carr and are currently archived here.
This file has been modified from that source (by Sir Robin) in the following ways:
- local variables holding pointers to string text have had that string text specified in a comment on that same line. This should make the conversation code easier to read.
- strings (both dereferenced ones in the code and also the ones added to comments as specified above) have been highlighted for easier reading
- function definitions have been anchored and function calls have been linked, to make it easier to follow the flow of the code
Start viewing the flow at main
// cnvdasm - ultima underworld conversation script disassembler / decompiler // // loading game strings // // conversation #231 // string block 0x0ee7 (3815), name Tyball // // converting to graph // searching functions // replacing expression opcodes // folding expressions // adding control structures // fixing up functions extern int private[31]; void main() { private[1] = 0; func_029d(); func_0012(); } // end func void func_0012() { private[0] = 1; } // end func void func_0020() { int locals[1]; if ( (((npc_goal == 5 || npc_goal == 6) || npc_goal == 9) && npc_gtarg == 1 || npc_attitude == 0) ) { locals[1] = 0; } else { locals[1] = 1; } // end if return locals[1]; } // end func void func_0063() { npc_gtarg = 1; npc_attitude = 1; npc_goal = 6; func_0012(); } // end func void func_007c() { npc_goal = 1; func_0012(); } // end func void func_008b() { npc_gtarg = 1; npc_goal = 5; npc_attitude = 1; func_0012(); } // end func void func_00a4() { npc_attitude = 6; } // end func void func_00b1() { npc_attitude = param1[0]play_hunger; func_0012(); } // end func void func_00c2() { npc_attitude = 2; func_0012(); } // end func void func_00d1() { npc_attitude = 1; func_0012(); } // end func void func_00e0() { func_0012(); } // end func void func_00ea() { param1[1] = game_days; param1[2] = game_mins; } // end func void func_0106() { int locals[4]; locals[2] = game_days - param2[1]; locals[3] = game_mins - param2[2]; if ( locals[3] < 0 ) { locals[3] = locals[3] + 1440; locals[2] = locals[2] - 1; } // end if if ( locals[2] >= param1[1] && locals[3] >= param1[2] ) { locals[1] = 1; } else { locals[1] = 0; } // end if return locals[1]; } // end func void func_018f() { param1[1] = game_days - param3[1]; param1[2] = game_mins - param3[2]; if ( param1[2] < 0 ) { param1[2] = param1[2] + 1440; param1[1] = param1[1] - 1; } // end if param1[1] = param2[1] - param1[1]; param1[2] = param2[2] - param1[2]; if ( param1[2] < 0 ) { param1[2] = param1[2] + 1440; param1[1] = param1[1] - 1; } // end if } // end func void func_0243() { param1[1] = game_days - param2[1]; param1[2] = game_mins - param2[2]; if ( param1[2] < 0 ) { param1[2] = param1[2] + 1440; param1[1] = param1[1] - 1; } // end if } // end func void func_029d() { int locals[47]; locals[1] = sex( 2, &locals[3], &locals[2] ); locals[2] = 1; locals[3] = 2; if ( private[0] ) { } else { say( "Ah, it is @GS8! It is good to meet thee again. It is regrettable that our acquiantance must be such a short one." ); locals[4] = 4; // "I demand that thou dost release Arial!" locals[5] = 5; // "What is thy fiendish plot?" locals[6] = 0; // "" locals[25] = babl_menu( 0, &locals[4] ); switch ( locals[25] ) { case 1: goto label_0304; break; case 2: goto label_0309; break; } // end switch label_0304:; say( "Oh, I'm afraid that that is quite impossible. I need the body of an innocent one to act as a vessel, and I am afraid that thine wilt not do. Besides, after all the trouble I went to, it would be a pity to let her go now, dost thou not think?" ); goto label_030e; label_0309:; say( "Oh, thou dost wonder why I abducted poor Arial? Perhaps I should spare thee so that thou canst see my incantation. The sight of a demon entering the body of a human is not one to be missed." ); goto label_030e; label_030e:; label_030e:; locals[26] = 8; // "I think thou art a villain and not worthy to live!" locals[27] = 10; // "Very well. If I must kill thee, I will." locals[28] = 0; // "" locals[47] = babl_menu( 0, &locals[26] ); switch ( locals[47] ) { case 1: say( "Ah, but regardless of my worthiness, I am afraid that I will live, and that thou wilt not." ); break; case 2: say( "Hm. I believe, dear @SS1, that the question is not whether thou must kill me, but whether thou canst. And the answer, of course, is no." ); break; } // end switch func_008b(); } // end if say( "Dear @GS8, I enjoy thy company greatly, but I am afraid that I have other matters to attend to than our conversation. If thou wilt do me the favor of expiring quickly, I would be much obliged." ); func_008b(); } // end func