2019-12-21 16:23:03 +00:00
|
|
|
/* ReC98
|
|
|
|
* -----
|
|
|
|
* Generic shot control functions
|
|
|
|
*/
|
|
|
|
|
2021-03-21 18:35:04 +00:00
|
|
|
#pragma option -zCmain_01_TEXT -zPmain_01
|
2019-12-21 16:23:03 +00:00
|
|
|
|
|
|
|
#include "th05/i_shot.hpp"
|
2022-03-06 22:16:48 +00:00
|
|
|
extern "C" {
|
2019-12-21 16:23:03 +00:00
|
|
|
#include "th02/snd/snd.h"
|
2022-03-06 22:16:48 +00:00
|
|
|
}
|
2019-12-21 16:23:03 +00:00
|
|
|
|
2020-03-30 18:17:28 +00:00
|
|
|
#pragma option -a2
|
|
|
|
|
2022-03-06 22:16:48 +00:00
|
|
|
char near shot_cycle_init(void)
|
2019-12-21 16:23:03 +00:00
|
|
|
{
|
|
|
|
char cycle_flag = 0;
|
|
|
|
switch(shot_time) {
|
|
|
|
case 18:
|
|
|
|
cycle_flag = SC_6X | SC_3X | SC_2X | SC_1X;
|
|
|
|
snd_se_play(1);
|
|
|
|
break;
|
|
|
|
case 15:
|
|
|
|
cycle_flag = SC_6X;
|
|
|
|
break;
|
|
|
|
case 12:
|
|
|
|
cycle_flag = SC_6X | SC_3X;
|
|
|
|
snd_se_play(1);
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
cycle_flag = SC_6X | SC_2X;
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
cycle_flag = SC_6X | SC_3X;
|
|
|
|
snd_se_play(1);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
cycle_flag = SC_6X;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
shot_ptr = shots;
|
|
|
|
shot_last_id = 0;
|
|
|
|
return cycle_flag;
|
|
|
|
}
|
|
|
|
|
|
|
|
void pascal near shot_l0(void)
|
|
|
|
{
|
|
|
|
if( (shot_cycle_init() & SC_3X) == 0) {
|
|
|
|
return;
|
|
|
|
}
|
2022-07-22 17:01:30 +00:00
|
|
|
Shot near *shot;
|
2022-06-26 09:32:25 +00:00
|
|
|
if(( shot = shots_add() ) != nullptr) {
|
2019-12-21 16:23:03 +00:00
|
|
|
shot->damage = 10;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void pascal near shot_l1(void)
|
|
|
|
{
|
|
|
|
if( (shot_cycle_init() & SC_3X) == 0) {
|
|
|
|
return;
|
|
|
|
}
|
2022-07-22 17:01:30 +00:00
|
|
|
Shot near *shot;
|
2022-06-26 09:32:25 +00:00
|
|
|
if(( shot = shots_add() ) != nullptr) {
|
2022-04-16 03:25:19 +00:00
|
|
|
shot_velocity_set(
|
|
|
|
&shot->pos.velocity, randring1_next8_and_ge_lt(-0x44, -0x3C)
|
|
|
|
);
|
2019-12-21 16:23:03 +00:00
|
|
|
shot->damage = 10;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|