touhou-pride-jam-2021/thpj3/objects/obj_boss_parent/Step_0.gml

63 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2021-06-11 04:39:22 -07:00
charge_timer--;
if (hp <= 0) {
with (obj_enemy_bullet_parent) {
instance_destroy();
}
2021-06-11 04:39:22 -07:00
if ( current_phase < phases ) {
current_phase++;
hp = phase_hp[current_phase];
charge_timer = BOSS_CHARGE_TIME;
phase_mode = MODE_CHARGE;
audio_play_sound( snd_boss_spellbreak, 1, false );
2021-06-11 04:39:22 -07:00
} else {
instance_destroy();
}
}
2021-06-12 14:57:20 -07:00
//attack patterns
2021-06-11 04:39:22 -07:00
if ( phase_mode == MODE_ACTIVE ) {
invuln = false;
2021-06-12 14:57:20 -07:00
if ( obj_wriggle.emergency ) {
charge_timer++
//stop shooting
} else if ( !obj_wriggle.emergency ) {
y += (( abs(charge_timer) % 60 ) - 30 ) / 30;
2021-06-11 04:39:22 -07:00
}
}
2021-06-12 14:57:20 -07:00
//animations in-between phases
2021-06-11 04:39:22 -07:00
if ( phase_mode == MODE_CHARGE ) {
invuln = true;
if ( !charge_timer ) {
phase_mode = MODE_ACTIVE;
}
y = _y;
2021-06-11 04:39:22 -07:00
}
2021-06-12 14:57:20 -07:00
//dialogue
2021-06-11 04:39:22 -07:00
if ( phase_mode == MODE_CHAT ) {
invuln = true;
if ( !obj_dialogue.dialogue_mode ) {
charge_timer = BOSS_CHARGE_TIME;
phase_mode = MODE_CHARGE;
}
}
2021-06-12 14:57:20 -07:00
//jumping on-screen
2021-06-11 04:39:22 -07:00
if ( phase_mode == MODE_APPROACH ) {
invuln = true;
2021-06-12 14:57:20 -07:00
hspeed = (15 - min( 15, (BOSS_APPROACH_TIME - charge_timer) / 2 ) ) * face_dir;
vspeed = 15 - min( 15, (BOSS_APPROACH_TIME - charge_timer) / 2 );
image_angle += 24;
2021-06-11 04:39:22 -07:00
if ( !charge_timer ) {
_y = y;
2021-06-12 14:57:20 -07:00
if ( file_exists( stagename + "_" + bossname + "_dialogue.txt" ) ) { // "stage#_bossname_dialogue.txt"
scr_dialogue_start( stagename + "_" + bossname + "_dialogue.txt" );
2021-06-11 04:39:22 -07:00
phase_mode = MODE_CHAT;
} else {
charge_timer = BOSS_CHARGE_TIME;
phase_mode = MODE_CHARGE;
}
}
}