// seg001:024D void __pascal far princess_crouching() { init_princess(); Char.x = 131; Char.y = 169; seqtbl_offset_char(seq_110_princess_crouching_PV2); // princess crouching [PV2] play_seq(); }
// seg001:032A void __pascal far init_ending_kid() { Char.charid = charid_0_kid; Char.x = 198; Char.y = 164; Char.direction = dir_FF_left; seqtbl_offset_char(seq_1_start_run); // start run play_seq(); }
// seg001:02E4 void __pascal far init_princess() { Char.charid = charid_5_princess; Char.x = 120; Char.y = 166; Char.direction = dir_FF_left; seqtbl_offset_char(seq_94_princess_stand_PV1); // princess stand [PV1] play_seq(); }
// seg001:0307 void __pascal far init_vizier() { Char.charid = charid_6_vizier; Char.x = 198; Char.y = 166; Char.direction = dir_FF_left; seqtbl_offset_char(seq_95_Jaffar_stand_PV1); // Jaffar stand [PV1] play_seq(); }
// seg001:022A void __pascal far init_mouse_go() { Char.charid = charid_24_mouse; Char.x = 199; Char.y = 167; Char.direction = dir_FF_left; seqtbl_offset_char(seq_105_mouse_forward); // mouse go play_seq(); }
// seg002:0000 void __pascal far do_init_shad(const byte *source,int seq_index) { memcpy_near(&Char, source, 7); seqtbl_offset_char(seq_index); Char.charid = charid_1_shadow; demo_time = 0; guard_skill = 3; guardhp_delta = guardhp_curr = guardhp_max = 4; saveshad(); }
// seg004:07BF void __pascal far chomped() { curr_room_modif[curr_tilepos] |= 0x80; // put blood if (Char.frame != 178 && Char.room == curr_room) { Char.x = x_bump[tile_col + 5] + 7; Char.x = char_dx_forward(7 - !Char.direction); Char.y = y_land[Char.curr_row + 1]; take_hp(100); play_sound(sound_46_chomped); // something chomped seqtbl_offset_char(54); // chomped play_seq(); } }
// seg004:04E4 void __pascal far bumped_fall() { short action; action = Char.action; Char.x = char_dx_forward(-4); if (action == actions_4_in_freefall) { Char.fall_x = 0; } else { seqtbl_offset_char(45); // fall after bumped play_seq(); } bumped_sound(); }
// seg002:0BCD void __pascal far hurt_by_sword() { short distance; if (Char.alive >= 0) return; if (Char.sword != sword_2_drawn) { // Being hurt when not in fighting pose means death. take_hp(100); seqtbl_offset_char(seq_85_stabbed_to_death); // dying (stabbed unarmed) loc_4276: if (get_tile_behind_char() != 0 || (distance = distance_to_edge_weight()) < 4 ) { seqtbl_offset_char(seq_85_stabbed_to_death); // dying (stabbed) if (Char.charid != charid_0_kid && Char.direction < dir_0_right && // looking left (curr_tile2 == tiles_4_gate || get_tile_at_char() == tiles_4_gate) ) { Char.x = x_bump[tile_col - (curr_tile2 != tiles_4_gate) + 5] + 7; Char.x = char_dx_forward(10); } Char.y = y_land[Char.curr_row + 1]; Char.fall_y = 0; } else { Char.x = char_dx_forward(distance - 20); load_fram_det_col(); inc_curr_row(); seqtbl_offset_char(seq_81_kid_pushed_off_ledge); // Kid/Guard is killed and pushed off the ledge } } else { // You can't hurt skeletons if (Char.charid != charid_4_skeleton) { if (take_hp(1)) goto loc_4276; } seqtbl_offset_char(seq_74_hit_by_sword); // being hit with sword Char.y = y_land[Char.curr_row + 1]; Char.fall_y = 0; } // sound 13: Kid hurt (by sword), sound 12: Guard hurt (by sword) play_sound(Char.charid == charid_0_kid ? sound_13_kid_hurt : sound_12_guard_hurt); play_seq(); }
// seg004:0520 void __pascal far bumped_floor(sbyte push_direction) { short frame; short seq_index; if (Char.sword != sword_2_drawn && (word)(y_land[Char.curr_row + 1] - Char.y) >= (word)15) { bumped_fall(); } else { Char.y = y_land[Char.curr_row + 1]; if (Char.fall_y >= 22) { Char.x = char_dx_forward(-5); } else { Char.fall_y = 0; if (Char.alive) { if (Char.sword == sword_2_drawn) { if (push_direction == Char.direction) { seqtbl_offset_char(65); // pushed forward with sword (Kid) play_seq(); Char.x = char_dx_forward(1); return; } else { seq_index = 64; // pushed back with sword } } else { frame = Char.frame; if (frame == 24 || frame == 25 || (frame >= 40 && frame < 43) || (frame >= 102 && frame < 107) ) { seq_index = 46; // bump into wall after run-jump (crouch) } else { seq_index = 47; // bump into wall } } seqtbl_offset_char(seq_index); play_seq(); bumped_sound(); } } } }
// seg002:07EB void __pascal far autocontrol_mouse() { if (Char.direction == dir_56_none) { return; } if (Char.action == actions_0_stand) { if (Char.x >= 200) { clear_char(); } } else { if (Char.x < 166) { seqtbl_offset_char(seq_107_mouse_stand_up_and_go); // mouse play_seq(); } } }
// seg004:07BF void __pascal far chomped() { #ifdef FIX_SKELETON_CHOMPER_BLOOD if (!(fixes->fix_skeleton_chomper_blood && Char.charid == charid_4_skeleton)) #endif curr_room_modif[curr_tilepos] |= 0x80; // put blood if (Char.frame != frame_178_chomped && Char.room == curr_room) { Char.x = x_bump[tile_col + 5] + 7; Char.x = char_dx_forward(7 - !Char.direction); Char.y = y_land[Char.curr_row + 1]; take_hp(100); play_sound(sound_46_chomped); // something chomped seqtbl_offset_char(seq_54_chomped); // chomped play_seq(); } }
// seg002:0D56 void __pascal far check_hurting() { short opp_frame, char_frame, distance, min_hurt_range; if (Char.sword != sword_2_drawn) return; if (Char.curr_row != Opp.curr_row) return; char_frame = Char.frame; // frames 153..154: poking with sword if (char_frame != frame_153_strike_3 && char_frame != frame_154_poking) return; // If char is poking ... distance = char_opp_dist(); opp_frame = Opp.frame; // frames 161 and 150: parrying if (distance < 0 || distance >= 29 || (opp_frame != frame_161_parry && opp_frame != frame_150_parry) ) { // ... and Opp is not parrying // frame 154: poking if (Char.frame == frame_154_poking) { if (Opp.sword < sword_2_drawn) { min_hurt_range = 8; } else { min_hurt_range = 12; } distance = char_opp_dist(); if (distance >= min_hurt_range && distance < 29) { Opp.action = actions_99_hurt; } } } else { Opp.frame = frame_161_parry; if (Char.charid != charid_0_kid) { justblocked = 4; } seqtbl_offset_char(seq_69_attack_was_parried); // attack was parried play_seq(); } // frame 154: poking // frame 161: parrying if (Char.frame == frame_154_poking && Opp.frame != frame_161_parry && Opp.action != actions_99_hurt) { play_sound(sound_11_sword_moving); // sword moving } }
// seg002:0E1F void __pascal far check_skel() { // Special event: skeleton wakes if (current_level == 3 && Guard.direction == dir_56_none && drawn_room == 1 && leveldoor_open != 0 && (Kid.curr_col == 2 || Kid.curr_col == 3) ) { get_tile(drawn_room, 5, 1); if (curr_tile2 == tiles_21_skeleton) { // erase skeleton curr_room_tiles[curr_tilepos] = tiles_1_floor; redraw_height = 24; set_redraw_full(curr_tilepos, 1); set_wipe(curr_tilepos, 1); ++curr_tilepos; set_redraw_full(curr_tilepos, 1); set_wipe(curr_tilepos, 1); Char.room = drawn_room; Char.curr_row = 1; Char.y = y_land[Char.curr_row + 1]; Char.curr_col = 5; Char.x = x_bump[Char.curr_col + 5] + 14; Char.direction = dir_FF_left; seqtbl_offset_char(seq_88_skel_wake_up); // skel wake up play_seq(); play_sound(sound_44_skel_alive); // skel alive guard_skill = 2; Char.alive = -1; guardhp_max = guardhp_curr = 3; Char.fall_x = Char.fall_y = 0; is_guard_notice = guard_refrac = 0; Char.sword = sword_2_drawn; Char.charid = charid_4_skeleton; saveshad(); } } }
// seg004:08C3 void __pascal far check_guard_bumped() { if ( Char.action == actions_1_run_jump && Char.alive < 0 && Char.sword >= sword_2_drawn ) { if ( #ifdef FIX_PUSH_GUARD_INTO_WALL // Should also check for a wall BEHIND the guard, instead of only the current tile (fixes->fix_push_guard_into_wall && get_tile_behind_char() == tiles_20_wall) || #endif get_tile_at_char() == tiles_20_wall || curr_tile2 == tiles_7_doortop_with_floor || (curr_tile2 == tiles_4_gate && can_bump_into_gate()) || (Char.direction >= dir_0_right && ( get_tile(curr_room, --tile_col, tile_row) == tiles_7_doortop_with_floor || (curr_tile2 == tiles_4_gate && can_bump_into_gate()) )) ) { load_frame_to_obj(); set_char_collision(); if (is_obstacle()) { short delta_x; delta_x = dist_from_wall_behind(curr_tile2); if (delta_x < 0 && delta_x > -13) { Char.x = char_dx_forward(-delta_x); seqtbl_offset_char(seq_65_bump_forward_with_sword); // pushed to wall with sword (Guard) play_seq(); load_fram_det_col(); } } } } }
// seg001:01F9 void __pascal far seqtbl_offset_kid_char(int seq_index) { loadkid(); seqtbl_offset_char(seq_index); savekid(); }
// seg001:01E0 void __pascal far seqtbl_offset_shad_char(int seq_index) { loadshad(); seqtbl_offset_char(seq_index); saveshad(); }
// seg001:0212 void __pascal far init_mouse_cu8() { init_mouse_go(); Char.x = 144; seqtbl_offset_char(seq_106_mouse); // mouse play_seq(); }
// seg002:0112 void __pascal far enter_guard() { word room_minus_1; word guard_tile; word frame; byte seq_hi; // arrays are indexed 0..23 instead of 1..24 room_minus_1 = drawn_room - 1; frame = Char.frame; // hm? guard_tile = level.guards_tile[room_minus_1]; if (guard_tile >= 30) return; Char.room = drawn_room; Char.curr_row = guard_tile / 10; Char.y = y_land[Char.curr_row + 1]; Char.x = level.guards_x[room_minus_1]; Char.curr_col = get_tile_div_mod_m7(Char.x); Char.direction = level.guards_dir[room_minus_1]; // only regular guards have different colors (and only on VGA) if (graphics_mode == gmMcgaVga && tbl_guard_type[current_level] == 0) { curr_guard_color = level.guards_color[room_minus_1]; } else { curr_guard_color = 0; } #ifdef REMEMBER_GUARD_HP int remembered_hp = (curr_guard_color & 0xF0) >> 4; #endif curr_guard_color &= 0x0F; // added; only least significant 4 bits are used for guard color // level 3 has skeletons with infinite lives if (current_level == 3) { Char.charid = charid_4_skeleton; } else { Char.charid = charid_2_guard; } seq_hi = level.guards_seq_hi[room_minus_1]; if (seq_hi == 0) { if (Char.charid == charid_4_skeleton) { Char.sword = sword_2_drawn; seqtbl_offset_char(seq_63_guard_stand_active); // stand active (when entering room) (skeleton) } else { Char.sword = sword_0_sheathed; seqtbl_offset_char(seq_77_guard_stand_inactive); // stand inactive (when entering room) } } else { Char.curr_seq = level.guards_seq_lo[room_minus_1] + (seq_hi << 8); } play_seq(); guard_skill = level.guards_skill[room_minus_1]; if (guard_skill >= 12) { guard_skill = 3; } frame = Char.frame; if (frame == frame_185_dead || frame == frame_177_spiked || frame == frame_178_chomped) { Char.alive = 1; draw_guard_hp(0, guardhp_curr); guardhp_curr = 0; } else { Char.alive = -1; justblocked = 0; guard_refrac = 0; is_guard_notice = 0; get_guard_hp(); #ifdef REMEMBER_GUARD_HP if (options.enable_remember_guard_hp && remembered_hp > 0) guardhp_delta = guardhp_curr = (word) remembered_hp; #endif } Char.fall_y = 0; Char.fall_x = 0; Char.action = actions_1_run_jump; saveshad(); }