Reply to Re: New Dmod: Adventurer's Adventure
If you don't have an account, just leave the password field blank.
For the above thing of detecting if the bomb was used but didn't hit the rock, you could just get the rock to set a variable, or sp_custom value on the bomb explosion sprite itself if the rock is hit, and then in the dam-bomn script check for that value and if it isn't set, it missed.
so in the rock script add the sp_custom line as the first line in the procedure, here's the full proc again:
And the new dam-bomn damage proc:
And then the spawned b-no-hit script, which is the script that will do what you want to happen when the bomb was used anywhere other than the rock, example:
so in the rock script add the sp_custom line as the first line in the procedure, here's the full proc again:
void hit(void) { int &rcrap = compare_sprite_script(&missle_source, "dam-bomn"); if (&rcrap == 1) { sp_custom("bomb_hit", &missle_source, 1); &mine_rock = 1; sp_hard(¤t_sprite, 1); draw_hard_sprite(¤t_sprite); sp_active(¤t_sprite, 0); playsound(43, 22050, 0,0,0); int &hold = sp_editor_num(¤t_sprite); if (&hold != 0) { editor_type(&hold, 1); } script_attach(1000); progress(); } kill_this_task(); }
And the new dam-bomn damage proc:
//Bomb noise void damage (void) { playsound(6, 32050, 0,0,0); &save_x = sp_custom("bomb_hit", ¤t_sprite, -1); if (&save_x < 1) { //make it so this only runs once sp_custom("bomb_hit", ¤t_sprite, 2); //spawn the script that will handle the rest so the damage proc running again doesn't interrupt spawn("b-no-hit"); } }
And then the spawned b-no-hit script, which is the script that will do what you want to happen when the bomb was used anywhere other than the rock, example:
void main(void) { int &mag = get_sprite_with_this_brain(16, 1); freeze(&mag); freeze(1); sp_dir(&mag, 6); say_stop("`1WOW DINK YOU HAD ONE JOB!", &mag); wait(200); say_stop("Alright well I guess your stuck there, bye, I'm out", 1); unfreeze(&mag); unfreeze(1); kill_this_task(); }