Example #1
0
// seg001:041C
void __pascal far end_sequence_anim() {
	disable_keys = 1;
	if (!is_sound_on) {
		turn_sound_on_off(0x0F);
	}
	copy_screen_rect(&screen_rect);
	play_sound(sound_26_embrace); // arrived to princess
	init_ending_princess();
	saveshad();
	init_ending_kid();
	savekid();
	if (proc_cutscene_frame(8)) return;
	seqtbl_offset_shad_char(seq_108_princess_turn_and_hug); // princess turn and hug [PV2]
	if (proc_cutscene_frame(5)) return;
	seqtbl_offset_kid_char(seq_13_stop_run); // stop run
	if (proc_cutscene_frame(2)) return;
	Kid.frame = 0;
	if (proc_cutscene_frame(39)) return;
	init_mouse_1();
	savekid();
	if (proc_cutscene_frame(9)) return;
	seqtbl_offset_kid_char(seq_101_mouse_stands_up); // mouse stands up
	if (proc_cutscene_frame(41)) return;
	fade_out_1();
	while (check_sound_playing()) idle();
}
Example #2
0
File: seg002.c Project: mfn/SDLPoP
// seg002:03C7
void __pascal far exit_room() {
	word leave;
	word kid_room_m1;
	leave = 0;
	if (exit_room_timer != 0) {
		--exit_room_timer;
		return;
	}
	loadkid();
	load_frame_to_obj();
	set_char_collision();
	roomleave_result = leave_room();
	if (roomleave_result < 0) {
		return;
	}
	savekid();
	next_room = Char.room;
	if (Guard.direction == dir_56_none) return;
	if (Guard.alive < 0 && Guard.sword == sword_2_drawn) {
		kid_room_m1 = Kid.room - 1;
		if (level.guards_tile[kid_room_m1] >= 30 ||
			level.guards_seq_hi[kid_room_m1] != 0
		) {
			if (roomleave_result == 0) {
				// left
				if (Guard.x >= 91) leave = 1;
				#ifdef FIX_GUARD_FOLLOWING_THROUGH_CLOSED_GATES
				else if (options.fix_guard_following_through_closed_gates && can_guard_see_kid != 2 &&
						Kid.sword != sword_2_drawn) {
					leave = 1;
				}
				#endif
			} else if (roomleave_result == 1) {
				// right
				if (Guard.x < 165) leave = 1;
				#ifdef FIX_GUARD_FOLLOWING_THROUGH_CLOSED_GATES
				else if (options.fix_guard_following_through_closed_gates && can_guard_see_kid != 2 &&
						 Kid.sword != sword_2_drawn) {
					leave = 1;
				}
				#endif
			} else if (roomleave_result == 2) {
				// up
				if (Guard.curr_row >= 0) leave = 1;
			} else {
				// down
				if (Guard.curr_row < 3) leave = 1;
			}
		} else {
			leave = 1;
		}
	} else {
		leave = 1;
	}
	if (leave) {
		leave_guard();
	} else {
		follow_guard();
	}
}
Example #3
0
// seg001:0128
void __pascal far play_kid_seq() {
	loadkid();
	if (Char.frame) {
		play_seq();
		savekid();
	}
}
Example #4
0
// seg000:0EA8
// returns 1 if level is restarted, 0 otherwise
int __pascal far play_kid_frame() {
	loadkid_and_opp();
	load_fram_det_col();
	check_killed_shadow();
	play_kid();
	if (upside_down && Char.alive >= 0) {
		upside_down = 0;
		need_redraw_because_flipped = 1;
	}
	if (is_restart_level) {
		return 1;
	}
	if (Char.room != 0) {
		play_seq();
		fall_accel();
		fall_speed();
		load_frame_to_obj();
		load_fram_det_col();
		set_char_collision();
		bump_into_opponent();
		check_collisions();
		check_bumped();
		check_gate_push();
		check_action();
		check_press();
		check_spike_below();
		if (resurrect_time == 0) {
			check_spiked();
			check_chomped_kid();
		}
		check_knock();
	}
	savekid();
	return 0;
}
Example #5
0
// seg001:05EC
void __pascal far pv_scene() {
	init_princess();
	saveshad();
	if (fade_in_1()) return;
	init_vizier();
	savekid();
	if (proc_cutscene_frame(2)) return;
	play_sound(sound_50_story_2_princess); // story 2: princess waiting
	do {
		if (proc_cutscene_frame(1)) return;
		//idle();
	} while(check_sound_playing());
	cutscene_frame_time = 8;
	if (proc_cutscene_frame(5)) return;
	play_sound(sound_4_gate_closing); // gate closing
	do {
		if (proc_cutscene_frame(1)) return;
	} while(check_sound_playing());
	play_sound(sound_51_princess_door_opening); // princess door opening
	if (proc_cutscene_frame(3)) return;
	seqtbl_offset_shad_char(98); // princess turn around [PV1]
	if (proc_cutscene_frame(5)) return;
	seqtbl_offset_kid_char(96); // Jaffar walk [PV1]
	if (proc_cutscene_frame(6)) return;
	play_sound(sound_53_story_3_Jaffar_comes); // story 3: Jaffar comes
	seqtbl_offset_kid_char(97); // Jaffar stop [PV1]
	if (proc_cutscene_frame(4)) return;
	if (proc_cutscene_frame(18)) return;
	seqtbl_offset_kid_char(96); // Jaffar walk [PV1]
	if (proc_cutscene_frame(30)) return;
	seqtbl_offset_kid_char(97); // Jaffar stop [PV1]
	if (proc_cutscene_frame(35)) return;
	seqtbl_offset_kid_char(102); // Jaffar conjuring [PV1]
	cutscene_frame_time = 7;
	if (proc_cutscene_frame(1)) return;
	seqtbl_offset_shad_char(99); // princess step back [PV1]
	if (proc_cutscene_frame(17)) return;
	hourglass_state = 1;
	flash_time = 5;
	flash_color = 15; // white
	do {
		if (proc_cutscene_frame(1)) return;
		//idle();
	} while(check_sound_playing());
	seqtbl_offset_kid_char(100); // Jaffar end conjuring and walk [PV1]
	hourglass_sandflow = 0;
	if (proc_cutscene_frame(6)) return;
	play_sound(sound_52_story_4_Jaffar_leaves); // story 4: Jaffar leaves
	if (proc_cutscene_frame(24)) return;
	hourglass_state = 2;
	if (proc_cutscene_frame(9)) return;
	seqtbl_offset_shad_char(113); // princess look down [PV1]
	if (proc_cutscene_frame(28)) return;
	fade_out_1();
}
Example #6
0
// seg001:03B7
void __pascal far cutscene_9() {
	play_sound(sound_35_cutscene_8_9); // cutscene 8, 9
	set_hourglass_state(hourglass_frame());
	princess_stand();
	saveshad();
	if (fade_in_1()) return;
	init_mouse_go();
	savekid();
	if (proc_cutscene_frame(5)) return;
	seqtbl_offset_shad_char(seq_112_princess_crouch_down_PV2); // princess crouch down [PV2]
	if (proc_cutscene_frame(9)) return;
	seqtbl_offset_kid_char(seq_114_mouse_stand); // mouse stand
	if (proc_cutscene_frame(58)) return;
	fade_out_1();
}
Example #7
0
// seg001:034D
void __pascal far cutscene_8() {
	play_sound(sound_35_cutscene_8_9); // cutscene 8, 9
	set_hourglass_state(hourglass_frame());
	init_mouse_cu8();
	savekid();
	princess_crouching();
	saveshad();
	if (fade_in_1()) return;
	if (proc_cutscene_frame(20)) return;
	seqtbl_offset_kid_char(seq_107_mouse_stand_up_and_go); // mouse stand up and go
	if (proc_cutscene_frame(20)) return;
	seqtbl_offset_shad_char(seq_111_princess_stand_up_PV2); // princess stand up [PV2]
	if (proc_cutscene_frame(20)) return;
	Kid.frame = 0;
	fade_out_1();
}
Example #8
0
File: seg002.c Project: mfn/SDLPoP
// seg002:0CD4
void __pascal far check_sword_hurt() {
	if (Guard.action == actions_99_hurt) {
		if (Kid.action == actions_99_hurt) {
			Kid.action = actions_1_run_jump;
		}
		loadshad();
		hurt_by_sword();
		saveshad();
		guard_refrac = refractimer[guard_skill];
	} else {
		if (Kid.action == actions_99_hurt) {
			loadkid();
			hurt_by_sword();
			savekid();
		}
	}
}
Example #9
0
File: seg002.c Project: mfn/SDLPoP
// seg002:1082
void __pascal far autocontrol_shadow_level12() {
	short opp_frame;
	short xdiff;
	if (Char.room == 15 && shadow_initialized == 0) {
		if (Opp.x >= 150) {
			do_init_shad(/*&*/init_shad_12, 7 /*fall*/);
			return;
		}
		shadow_initialized = 1;
	}
	if (Char.sword >= sword_2_drawn) {
		// if the Kid puts his sword away, the shadow does the same,
		// but only if the shadow was already hurt (?)
		if (offguard == 0 || guard_refrac == 0) {
			autocontrol_guard_active();
		} else {
			move_4_down();
		}
		return;
	}
	if (Opp.sword >= sword_2_drawn || offguard == 0) {
		xdiff = 0x7000; // bugfix/workaround
		// This behavior matches the DOS version but not the Apple II source.
		if (can_guard_see_kid < 2 || (xdiff = char_opp_dist()) >= 90) {
			if (xdiff < 0) {
				move_2_backward();
			}
			return;
		}
		// Shadow draws his sword
		if (Char.frame == 15) {
			move_down_forw();
		}
		return;
	}
	if (char_opp_dist() < 10) {
		// unite with the shadow
		flash_color = color_15_white; // white
		flash_time = 18;
		// get an extra HP for uniting the shadow
		add_life();
		// time of Kid-shadow flash
		united_with_shadow = 42;
		// put the Kid where the shadow was
		Char.charid = charid_0_kid;
		savekid();
		// remove the shadow
		clear_char();
		return;
	}
	if (can_guard_see_kid == 2) {
		// If Kid runs to shadow, shadow runs to Kid.
		opp_frame = Opp.frame;
		// frames 1..14: running
		// frames 121..132: stepping
		if ((opp_frame >= frame_3_start_run && opp_frame < frame_15_stand) ||
			(opp_frame >= frame_127_stepping_7 && opp_frame < 133)
		) {
			move_1_forward();
		}
	}
}
Example #10
0
// seg001:01F9
void __pascal far seqtbl_offset_kid_char(int seq_index) {
	loadkid();
	seqtbl_offset_char(seq_index);
	savekid();
}